Question : Excel VBA Find First Find last

I need to construct a vba function that when given a column  in a table (Listobject)
it will find the first and last occurence of a given string . It will than copy the data between
these occurences and the rows to another sheet, please help.
 

Answer : Excel VBA Find First Find last

Use the code in the snippet, but instead of column numbers (in example column (1) ) you can use it to get that information from the listobject.
1:
2:
3:
4:
5:
6:
7:
8:
9:
If Columns(1).Rows(1).Value = "" Then
first = Columns(1).End(xlDown).Address
Else
first = Columns(1).Rows(1).Address
End If

last = Columns(1).SpecialCells(xlCellTypeLastCell).Address
    
Range(first & ":" & last).Copy Destination:=Workbooks(1).Sheets(2).Cells(1)
Random Solutions  
 
programming4us programming4us