ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   not calling (https://www.excelbanter.com/excel-programming/387982-not-calling.html)

Curt

not calling
 
will someone tell me why this does't call the macro. This is in the code for
a user form. It is acessed by an option button. Do I need to put the macro
procedure into the code of the option button?
Thanks

Private Sub OptionButton30_Click()
'Announcer Cards
Call AAAA
Worksheets("Data").Range("A4:A100,D4:D100,E4:E100, G4:G100,L4:L100").Copy
Worksheets("Announcer").Range("A2").PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
'Destination:=Worksheets("Announcer").Range("A2")
End Sub


JLGWhiz

not calling
 
If the macro is in the standard module, it should run. I don't even use Call
for mine. I just put the procedure name on a line and it runs, so you either
have the macro as a private sub or there is some other disconnect.

"Curt" wrote:

will someone tell me why this does't call the macro. This is in the code for
a user form. It is acessed by an option button. Do I need to put the macro
procedure into the code of the option button?
Thanks

Private Sub OptionButton30_Click()
'Announcer Cards
Call AAAA
Worksheets("Data").Range("A4:A100,D4:D100,E4:E100, G4:G100,L4:L100").Copy
Worksheets("Announcer").Range("A2").PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
'Destination:=Worksheets("Announcer").Range("A2")
End Sub


Mike H

not calling
 
Hi Curt,

I attached your code to a cmd button (Right click the button and view code)
on a uaerform and created a workbook module call Sub AAAA() and it worked
perfectly for me.

Mike

"Curt" wrote:

will someone tell me why this does't call the macro. This is in the code for
a user form. It is acessed by an option button. Do I need to put the macro
procedure into the code of the option button?
Thanks

Private Sub OptionButton30_Click()
'Announcer Cards
Call AAAA
Worksheets("Data").Range("A4:A100,D4:D100,E4:E100, G4:G100,L4:L100").Copy
Worksheets("Announcer").Range("A2").PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
'Destination:=Worksheets("Announcer").Range("A2")
End Sub


Halim

not calling
 
Hi,

Ensure your Sub AAAA() is a public or standard sub or not a Private Sub...
and also Sub AAAA() is a procedure in a same VBAProject too.
--

Regards,

Halim


"JLGWhiz" wrote:

If the macro is in the standard module, it should run. I don't even use Call
for mine. I just put the procedure name on a line and it runs, so you either
have the macro as a private sub or there is some other disconnect.

"Curt" wrote:

will someone tell me why this does't call the macro. This is in the code for
a user form. It is acessed by an option button. Do I need to put the macro
procedure into the code of the option button?
Thanks

Private Sub OptionButton30_Click()
'Announcer Cards
Call AAAA
Worksheets("Data").Range("A4:A100,D4:D100,E4:E100, G4:G100,L4:L100").Copy
Worksheets("Announcer").Range("A2").PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
'Destination:=Worksheets("Announcer").Range("A2")
End Sub



All times are GMT +1. The time now is 12:18 AM.

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