Hey!
I'm currently writing a code but I need to know which range holds a certain. I have the code for the find but Ideally i want to do something like this:
Sub
FindFunction(CertainWord)
Set FoundRange= (I Would like for the code to return the range here so I can set it and continue with my code)
FindFunction(CertainWord)
With Sheets("Output")
Set dFound = .Columns(4).Find(What:=CertainWord, After:=.Cells(1, 4), LookIn:=xlValues, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
End With
End Function
Thank you for the help!
I'm currently writing a code but I need to know which range holds a certain. I have the code for the find but Ideally i want to do something like this:
Sub
FindFunction(CertainWord)
Set FoundRange= (I Would like for the code to return the range here so I can set it and continue with my code)
FindFunction(CertainWord)
With Sheets("Output")
Set dFound = .Columns(4).Find(What:=CertainWord, After:=.Cells(1, 4), LookIn:=xlValues, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
End With
End Function
Thank you for the help!