-1

I want to display a message box that will show both things:

1)A result from a hlookup calculation 2)General Text

The hloohup itself is working (I tested the Msg Box with it only) but I don't know how to concatenate "Text" + hllokup result.

The error is: invalid procedure call or argument

Any help would be really appreciated!

This is what I have as of now:

Sub bet_result()
Dim lookarray As Range
Dim rng2 As Range
Dim ws As Worksheet

Set ws = Sheets("XXX")
Set rng2 = ws.Range("C7")
Set lookarray = ws.Range("K5:Q38")



MsgBox rng2.Value & " " & "Text" & WorksheetFunction.Hlookup(rng2, lookarray, 34, False) 



End Sub
Community
  • 1
  • 1

1 Answers1

0

try adding a variable and assign it the Hlookup value

Sub bet_result()
Dim lookarray As Range
Dim ws As Worksheet

Set ws = Sheets("XXX")
rng2 = ws.Range("C7").value
Set lookarray = ws.Range("K5:Q38")
lookup = WorksheetFunction.Hlookup(rng2, lookarray, 34, False)

MsgBox rng2 & " " & "Text" & lookup 

End Sub

Sorry for my bad english im for argentina

jpalmerio
  • 1
  • 2