Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50163

Test to see if a Row falls within a range of rows

$
0
0
I am trying to create a button that removes a row but I do not know how to create the conditional to make sure the row isn't within the first 6 rows before it is deleted. Can anyone help me with this?

Code:

Sub OkayCancel()
Dim LResponse As Integer
LResponse = MsgBox("Do you wish to continue?", vbYesNo, "Continue")
ActiveCell.EntireRow.Select
If LResponse = vbYes And {The row isnt within the first 6 rows} Then
Selection.Delete Shift:=xlUp
 Else
 End If
End Sub


Viewing all articles
Browse latest Browse all 50163

Trending Articles