Hi everyone,
I'm looking for a macro that does the following:
Sheet1 - Range G2:G65 do while loop ending with "End" - needs to be compared with Sheet 2 Range F3:F2000 Do until ""
each time the first loop finds a non blank value, it jumps into the second loop to look for and replace exact values
Can anyone help, i'm at my wits end... Below is what I have at the minute, please bear with me, i'm trying to teach myself VBA... (it may take a while!!)
Sub FindReplace()
Dim Counter3, Counter4 As Integer
Counter3 = 3
Counter4 = 2
Do Until ThisWorkbook.Sheets("Obs Sheet").Cells(Counter3, 6).Value = ""
If ThisWorkbook.Sheets("Reports Input").Range("G" & Counter4).Value = ThisWorkbook.Sheets("Obs Sheet").Range("F" & Counter3).Value Then
ThisWorkbook.Sheets("Obs Sheet").Range("F" & Counter3).Value = ThisWorkbook.Sheets("Reports Input").Range("A" & Counter4).Value
End If
Counter3 = Counter3 + 1
Loop
End Sub
I'm looking for a macro that does the following:
Sheet1 - Range G2:G65 do while loop ending with "End" - needs to be compared with Sheet 2 Range F3:F2000 Do until ""
each time the first loop finds a non blank value, it jumps into the second loop to look for and replace exact values
Can anyone help, i'm at my wits end... Below is what I have at the minute, please bear with me, i'm trying to teach myself VBA... (it may take a while!!)
Sub FindReplace()
Dim Counter3, Counter4 As Integer
Counter3 = 3
Counter4 = 2
Do Until ThisWorkbook.Sheets("Obs Sheet").Cells(Counter3, 6).Value = ""
If ThisWorkbook.Sheets("Reports Input").Range("G" & Counter4).Value = ThisWorkbook.Sheets("Obs Sheet").Range("F" & Counter3).Value Then
ThisWorkbook.Sheets("Obs Sheet").Range("F" & Counter3).Value = ThisWorkbook.Sheets("Reports Input").Range("A" & Counter4).Value
End If
Counter3 = Counter3 + 1
Loop
End Sub
Last edited: