using data in highlighted cells

12beavah

New Member
Joined
Jan 13, 2002
Messages
2
OK this is what I am trying to do..

Have the user click on a cell,

Click on a macro button that will bring
up a simple promt box asking for a value.

Take the number from the input box and subtract it from the highlighted cell.

Then display the new number in the highlighted cell.

Any help on this would be great.
Thank you in advance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You can try it with an InputBox, like this:

Sub test()
Prompt1 = "Enter a value
Title1 = "Input requested
Cell_Value = ActiveCell.Value
User_Value = Application.InputBox(Prompt1, Title1, Type:=1)
ActiveCell.Value = Cell_Value - User_Value
End Sub
 
Upvote 0
Hi 12beavah,

Have you considered using Paste Special|Subtract for this. It works nicely for what your trying to accomplish.

giacomo
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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