I am trying to find a row with a string value (for example "Safe") and want to delete all the rows leading from there. However, I am getting a type mismatch error in the last line (Rows("b:500").EntireRow.Delete). Can't seem to figure out whats wrong with my code!!!!!
sheetname = ActiveSheet.Name
Dim r As Range
Set r = ActiveSheet.Cells.Find("Safe")
Dim a() As String
a = Split(r.Address, "$")
Dim b As Integer
b = CInt(a(2))
Rows("b:500").EntireRow.Delete
Help please
Thanks.
sheetname = ActiveSheet.Name
Dim r As Range
Set r = ActiveSheet.Cells.Find("Safe")
Dim a() As String
a = Split(r.Address, "$")
Dim b As Integer
b = CInt(a(2))
Rows("b:500").EntireRow.Delete
Help please

Thanks.