Hi
I am having a mare!
I need to do a VLook up in VBA, been scouring the web to see how to do it and nothing works.
My latest attempt is
Sub CommentAddOrEdit()
Dim Result As String
Sheets("Sheet1").Select
' Result = Str(Application.WorksheetFunction.VLookup(D12, Range("A20:B23"), 2, False))
Result = Application.WorksheetFunction.VLookup(D12, Range("A20:B23"), 2, False)
MsgBox "The result is " & Result
End Sub
What I want to do is create a message box using the active cell as input for the VLookUp and return multiple values back and display them in a message box.
I'm crap at VBA, so apologies for any bad stuff above,
all help appreciated!
I am having a mare!
I need to do a VLook up in VBA, been scouring the web to see how to do it and nothing works.
My latest attempt is
Sub CommentAddOrEdit()
Dim Result As String
Sheets("Sheet1").Select
' Result = Str(Application.WorksheetFunction.VLookup(D12, Range("A20:B23"), 2, False))
Result = Application.WorksheetFunction.VLookup(D12, Range("A20:B23"), 2, False)
MsgBox "The result is " & Result
End Sub
What I want to do is create a message box using the active cell as input for the VLookUp and return multiple values back and display them in a message box.
I'm crap at VBA, so apologies for any bad stuff above,
all help appreciated!