I have copied this VBA from a site and tried to change to suit my requirements. It was to search for the word "HZI" in a column (column BO), if a match then it returns the date from another cell on the same row (column BL). It works if there is HZI in any part of the cell, I only need it to only return the date when the cell starts with HZI, please help!
VBA Code:
Sub FindPARTMENT()
Dim ws As Worksheet
Dim match As Range
Dim findMe As String
Dim findOffset As String
Dim sAdr As String
Application.ScreenUpdating = False
Set ws = ThisWorkbook.ActiveSheet
findMe = "HZI"
Set match = ws.Range("BO:BO").Find(findMe)
If Not match Is Nothing Then
sAdr = match.Address
Do
match.Offset(0, 18).Value = match.Offset(0, -3).Value
Set match = ws.Range("BO:BO").FindNext(match)
Loop Until match Is Nothing Or match.Address = sAdr
End If
End Sub
Last edited by a moderator: