This is for a pricing sheet and i want to be able to add the amount in A1 to all the cells that contain a price that needs to be changed.
How do i do a VBA worksheet_change or a worksheet_calculate procedure?
This is for a pricing sheet and i want to be able to add the amount in A1 to all the cells that contain a price that needs to be changed.
How do i do a VBA worksheet_change or a worksheet_calculate procedure?
Hi Boogmeister,Originally Posted by Boogmeister11
When you say i want to be able to add the amount in A1 to all the cells that contain a price that needs to be changed, you can do this by copying A1, then selecting the range of cells that need the price changed, then Paste > Special > Operation > Add. This will add the amount in A1 to all the prices.
Is this what you are trying to do?
oldchippy![]()
Adding further to what oldchippy suggested, record a macro when you are doing that. So the steps would be something like:
1. Tools > Macro > Record new macro
2. copy A1
3. Select all the cells to which you want to add A1
4. Edit > Paste special > Add
5. Tools > Macro > Stop recording
You can now call this macro as many times as you want to add. The macro generated will look something like this:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/18/2006 by pc-user
'
'
Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Range("C1:C4").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
End Sub
You may add a button on the worksheet and link the macro to this button, or better still add a worksheet change event for target cell A1 so every time you change the value in A1, all the cells with the prices automatically change.
Mangesh
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks