hi there , is there some way which i can select all the row inbetween 2 specific words ... say onshore , offshore , on and off shore ..
thanks in advance
hi there , is there some way which i can select all the row inbetween 2 specific words ... say onshore , offshore , on and off shore ..
thanks in advance
Try this:
Option Explicit Sub SelectRange() Dim FirstRow As Long Dim LastRow As Long On Error Resume Next FirstRow = Cells.Find(What:="On Shore", After:=Range("IV65536"), LookIn:=xlValues, LookAt:= _ xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext).Row LastRow = Cells.Find(What:="Off Shore", After:=Range("A1"), LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row On Error GoTo 0 If FirstRow > 0 And LastRow > 0 Then Range("A" & FirstRow + 1 & ":IV" & LastRow - 1).Select End If End Sub