I have a macro
Sub DELETING()
For MY_ROWS = Range("E106").End(xlUp).Row To 1 Step -1
If IsEmpty(Range("E" & MY_ROWS)) Then
Rows(MY_ROWS).Delete
End If
Next MY_ROWS
End Sub
Which deletes rows which have cell E empty, between rows number 1 and 106.
Now I want to delete rows which have cell E empty, between rows number 4 and a row number which I give in an InputBoox. It will vary in different situations.
Something like this
Dim strLastrownumber As Integer
strLastrownumber = InputBox("Give last deleted row", "Number")
For MY_ROWS = Range("E" & ????).End(xlUp).Row To 1 Step -1
What do I put in Range("E" & ????).End(xlUp).Row To 1 Step -1
or how can I do this?
Pekka
Sub DELETING()
For MY_ROWS = Range("E106").End(xlUp).Row To 1 Step -1
If IsEmpty(Range("E" & MY_ROWS)) Then
Rows(MY_ROWS).Delete
End If
Next MY_ROWS
End Sub
Which deletes rows which have cell E empty, between rows number 1 and 106.
Now I want to delete rows which have cell E empty, between rows number 4 and a row number which I give in an InputBoox. It will vary in different situations.
Something like this
Dim strLastrownumber As Integer
strLastrownumber = InputBox("Give last deleted row", "Number")
For MY_ROWS = Range("E" & ????).End(xlUp).Row To 1 Step -1
What do I put in Range("E" & ????).End(xlUp).Row To 1 Step -1
or how can I do this?
Pekka