ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   still can't assign MACRO (https://www.excelbanter.com/excel-programming/302073-still-cant-assign-macro.html)

grin2000[_11_]

still can't assign MACRO
 
I have an imput box in cell F73. The only things that can be imputte
inside that cell is a dollar amount.

I want a macro to run only after someone has entered a number in tha
cell and right after he/she imputs the amount and presses Enter.

Can this be done in this manner or will I still need to place a butto
next to the cell to click once an amount has been imputted?

Thanks, I appreciate the help.

Pressing "Enter" to run macro

even better. It can be automatic
right click sheet tabview codecopy/paste this. Change cell to suit
Use A
instead of a.

Private Sub Worksheet_Change(ByVal Target As Range)
if target.address="$A$1" then call mymacro
End Sub


--
Don Guillett
SalesAid Software
Pressing "Enter" to run macro




I get a "compiled error" when I try it this way.

Can someone help me please?
I get a "compiled error" when I try it this way.

Can someone help me please

--
Message posted from
http://www.ExcelForum.com


Tom Ogilvy

still can't assign MACRO
 
Private Sub Worksheet_Change(ByVal Target As Range)
On error goto ErrHandler

if target.address="$F$73" then
Application.EnableEvents = False
if not isnumeric(Target) then
msgbox "Please Enter a dollar amount"
Target.Clearcontents
end if
end if
ErrHandler:
Application.EnableEvents = True
End Sub

Not sure what criteria you want to enforce to identify a dollar amount.

--
Regards,
Tom Ogilvy



"grin2000 " <<grin2000.188apw

@excelforum-nospam.com wrote in message
...
I have an imput box in cell F73. The only things that can be imputted
inside that cell is a dollar amount.

I want a macro to run only after someone has entered a number in that
cell and right after he/she imputs the amount and presses Enter.

Can this be done in this manner or will I still need to place a button
next to the cell to click once an amount has been imputted?

Thanks, I appreciate the help.

Pressing "Enter" to run macro

even better. It can be automatic
right click sheet tabview codecopy/paste this. Change cell to suit.
Use A
instead of a.

Private Sub Worksheet_Change(ByVal Target As Range)
if target.address="$A$1" then call mymacro
End Sub


--
Don Guillett
SalesAid Software
Pressing "Enter" to run macro




I get a "compiled error" when I try it this way.

Can someone help me please?
I get a "compiled error" when I try it this way.

Can someone help me please?


---
Message posted from
http://www.ExcelForum.com/




grin2000[_13_]

still can't assign MACRO
 
where in the macro do I have it call my macro after the amount i
inputted

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

still can't assign MACRO
 
after it passes the test that it isn't numeric.

--
Regards,
Tom Ogilvy

"grin2000 " wrote in message
...
where in the macro do I have it call my macro after the amount is
inputted?


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com