I am trying to write code to find ranges.
Sample data:
CLP 32 21
32
323
32
CLP 54
534
hg
555
CLP
32
23
I want to identify all rows below any CLP starting row and before next CLP. I put space inbetween to empahsis what I am looking for. I can identify the row number which has a CLP but I do not know how to store these numbers. Even better would be to identify ranges of rows below each CLP and before the next CLP. Once I have a range identified I want to eliminate any duplicate rows for that section.
Code so far just identifies rows which CLP
For i = 1 to 100
If cells(i,1) like "*CLP*" then
msgbox "Row is " i
end if
next i
end sub
I need to store row numbers and or get ranges for each of subsets.
Need help
Thanks
Sample data:
CLP 32 21
32
323
32
CLP 54
534
hg
555
CLP
32
23
I want to identify all rows below any CLP starting row and before next CLP. I put space inbetween to empahsis what I am looking for. I can identify the row number which has a CLP but I do not know how to store these numbers. Even better would be to identify ranges of rows below each CLP and before the next CLP. Once I have a range identified I want to eliminate any duplicate rows for that section.
Code so far just identifies rows which CLP
For i = 1 to 100
If cells(i,1) like "*CLP*" then
msgbox "Row is " i
end if
next i
end sub
I need to store row numbers and or get ranges for each of subsets.
Need help
Thanks