Thread: Macro help
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Macro help

This problem is going all over the place. Place code on a vba sheet page
(not module). If code is to run on sheet2, then right click tab on bottom of
worksheet (sheet2) and select view code. Then copy code below. If code is
needed on more than one sheet the same code has to be place in each sheet of
VBA.

Sub worksheet_change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo error_return
If Target.Column = 3 Then 'column C
If IsNumeric(Target) Then
Target = 12 * Target
End If
End If
error_return:
Application.EnableEvents = True

End Sub
"Jeremy McClung" wrote:

This will apply to a column. The user wants the calculation do be done as
soon as they press enter following the entry of the number. How would I use
a worksheet change event?

"Joel" wrote:

Is there certain columns or ranges that this will apply to? The best way of
accomplishing this is with a worksheet change event. the other choice is to
have a button that the user presses after he enters the data. One issue is
after enter the active cell is one row below where the data was entered.

"Jeremy McClung" wrote:

The user is requesting to:
1.) enter in the number
2.) press enter and have that number * 12 displayed.

They can't do the copy and paste steps. There needs to be only those two
steps.



"Joel" wrote:

Rather than a macro us an axilary cell and the paste special value only in
orignal cell
fro example if you data is in A1
in G1 put the following
=12*A1

Then copy g1 and select cell A1. Then use pastespecial and select value

"Jeremy McClung" wrote:

I need to enter a monthly dollar amount and have the amount multiply by 12
and display in the same cell. I cannot use a formula due to the circular
reference. Any help writing a macro that would do the calculation for me?