Application.Inputbox return worksheet name

btadams

Well-known Member
Joined
Jan 6, 2003
Messages
1,943
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,
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try this.
Code:
MsgBox rngMyRng.Worksheet.Name
 
Upvote 0

Forum statistics

Threads
1,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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