Hi All,
I have a massive headache with trying to find solution to my problem. I have a massive report in which I'm analyzing frequency of deliveries.
Please find attached file.
I have marked with comment in which part of the code i think the offset loop will have to go. PLEASE HELP!
Alternatively I'm open to suggestions how to add numbers between "Gap" word resetting count after nex Gap word example:
"Gap 1 Gap 1 1 Gap" will result in having 1 in one cell and 2 in the next one
Kind Regards
Toffee
I have a massive headache with trying to find solution to my problem. I have a massive report in which I'm analyzing frequency of deliveries.
Please find attached file.
I have marked with comment in which part of the code i think the offset loop will have to go. PLEASE HELP!
Code:
Sub MultipleSearch()
' Get name to search
Dim name As String: name = "Gap"
Dim Startt
Dim Endd
' Get search range
Dim rgSearch As Range
Set rgSearch = Range("BT6:EH647")
Dim cell As Range
Set cell = rgSearch.find(name)
' If not found then exit
If cell Is Nothing Then
Debug.Print "Not found"
Exit Sub
End If
' Store first cell address
Dim firstCellAddress As String
firstCellAddress = cell.Address
' Find all cells containing 0
Do
Range("EF2") = cell.Address
Set cell = rgSearch.FindNext(cell)
Range("EG2") = cell.Address
Range("EH2").Select
Selection.Copy
Range("EI6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ApplicationCutCopyMode = False
'some were here or after the final loop i would like to add that will
make sure that cell EH2 will be copied to row below because it found every possible instance in the current row
Loop While firstCellAddress <> cell.Address
End Sub
"Gap 1 Gap 1 1 Gap" will result in having 1 in one cell and 2 in the next one
Kind Regards
Toffee