Application.Inputbox return worksheet name

btadams

Well-known Member
Joined
Jan 6, 2003
Messages
1,936
I'm using the Application.Inputbox method to have the user select a cell containing a numerical value:

Code:
        Set rngMyRng = Application.InputBox("Select cell containing Upper Spec/Control Limit", "Add Spec/Control Limits", , , , , , 8)

When the user selects a cell in a different worksheet, it is displayed in the inputbox as ='Sheet 1'!$A$1

However rngMyRng.Address only returns $A$1. How can I get it to return the sheet name as well?

Thanks,
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,047
Office Version
  1. 365
Platform
  1. Windows
Try this.
Code:
MsgBox rngMyRng.Worksheet.Name
 

Watch MrExcel Video

Forum statistics

Threads
1,118,068
Messages
5,570,003
Members
412,304
Latest member
citrus
Top