Variable User Input - Either a Fixed Input or Cell Reference

bman100

New Member
Joined
Apr 28, 2010
Messages
14
I would like to give a user the option of either inputting a fixed number or making reference to another worksheet, but all within one cell if possible. Therefore, it would be a decision first (do you want to input: 1) a fixed number or 2) utilize a reference to another worksheet that contains all the detail), and depending on the decision, the user inputs a number or the cell reference is input.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Something like this should do it:

Code:
Sub GetCellValueOrRef()
    ActiveCell.FormulaR1C1 = Application.InputBox("Please enter a number or point to the cell with the number you wish to use", , , , , , , 0)
End Sub
 
Upvote 0
Thanks jkpieterse. The code you sent was very instructive, but I wasn't very clear in my original post. I'm looking for a drop down where the use can first choose to input either a fixed number or can choose to utilize a reference to another cell (I will put this cell reference in the reference). I want to calculate costs and the user can either choose to plug in a number or can choose to select the reference (which is connected to another worksheet that has the detail). This is for a pro forma, and typically you enter a plug number initially and then later on you update the entry with detail (that can be set forth in the worksheet). I hope this help clarify.


Something like this should do it:

Code:
Sub GetCellValueOrRef()
    ActiveCell.FormulaR1C1 = Application.InputBox("Please enter a number or point to the cell with the number you wish to use", , , , , , , 0)
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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