![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Jan 2002
Posts: 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. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Posts: 112
|
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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 1,802
|
Hi 12beavah,
Have you considered using Paste Special|Subtract for this. It works nicely for what your trying to accomplish. giacomo |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|