Using a Cell Address as part of a Lookup formula

stirlingmw

Board Regular
Joined
Feb 18, 2013
Messages
75
Morning All
I am trying to put together a "Help" button that describes what data should in added to certain cells.

What I have is a worksheet "Help" that in column A has a list of all of the cell addresses from my "Data" worksheet that have an input function. I.e. cell $K6$ = data input of Date and therefore Column A in Help has $K6$ and Column B has an explanation "Input a Date".

I can get the lookup function to work if an using a Text string to locate the cell address in Column A, but I want to be able to use ActiveCell.Address to locate the required text. So if I selected cell $K$6 in the "data" worksheet I want the lookup to search column A for the text $K$6 and return what is in Column B.

If I substitute ACell for the text "$K$6" it works.

VBA Code:
Sub LookUpHelp()
    Dim sRes As String
    Dim ACell As String
    
    ACell = ActiveCell.address
    sRes = Application.VLookup(ACell, Worksheets("Help").Range("A1:B10"), 2)
    
    MsgBox sRes
    
End Sub

Any ideas?

TIA

Steve
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
VBA is trying to match the value in cell K6

Amend one line
VBA Code:
ACell = "" & ActiveCell.Address & ""
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top