ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommandButton Question (https://www.excelbanter.com/excel-programming/363707-commandbutton-question.html)

Magnivy

CommandButton Question
 
I inserted a CommandButton into a worksheet. I'm trying to have the
CommandButton run another macro that I have in a different module (Module 4).
The code that I've used is

Private Sub CommandButton1_Click()
Call Module4.MACRO1
End Sub

However, instead of executing the macro, it displays the VBE window for
CommandButton1 (and shows the above code).

How can I have the CommandButton run the macro instead of displaying the VBE?

Thanks in advance for your help!

Magnivy


Die_Another_Day

CommandButton Question
 
You're making it too dificult. Try this:

Call Macro1

HTH

Die_Another_Day

Magnivy wrote:
I inserted a CommandButton into a worksheet. I'm trying to have the
CommandButton run another macro that I have in a different module (Module 4).
The code that I've used is

Private Sub CommandButton1_Click()
Call Module4.MACRO1
End Sub

However, instead of executing the macro, it displays the VBE window for
CommandButton1 (and shows the above code).

How can I have the CommandButton run the macro instead of displaying the VBE?

Thanks in advance for your help!

Magnivy



Magnivy

CommandButton Question
 
I tried another time and it worked. Please disregard the question below.

Magnivy
"Magnivy" wrote:

I inserted a CommandButton into a worksheet. I'm trying to have the
CommandButton run another macro that I have in a different module (Module 4).
The code that I've used is

Private Sub CommandButton1_Click()
Call Module4.MACRO1
End Sub

However, instead of executing the macro, it displays the VBE window for
CommandButton1 (and shows the above code).

How can I have the CommandButton run the macro instead of displaying the VBE?

Thanks in advance for your help!

Magnivy


Jeff Standen[_2_]

CommandButton Question
 
Sounds like you're still in design mode and you're double clicking - is that
possible?

Jeff

"Magnivy" wrote in message
...
I inserted a CommandButton into a worksheet. I'm trying to have the
CommandButton run another macro that I have in a different module (Module
4).
The code that I've used is

Private Sub CommandButton1_Click()
Call Module4.MACRO1
End Sub

However, instead of executing the macro, it displays the VBE window for
CommandButton1 (and shows the above code).

How can I have the CommandButton run the macro instead of displaying the
VBE?

Thanks in advance for your help!

Magnivy




Bearacade[_8_]

CommandButton Question
 

Make sure you are not in design mode.

To check, goto View, Toolbars, Control Toolbox, is the Design Mode ico
highlighted?

When you mouse over the Commandbutton, do you see an arrow (norma
mode)? or an arrow with direction arrows around it (design mode)

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=54997


Magnivy

CommandButton Question
 
Yep, I was in design mode. Thanks a lot for your help Bearacade!

"Bearacade" wrote:


Make sure you are not in design mode.

To check, goto View, Toolbars, Control Toolbox, is the Design Mode icon
highlighted?

When you mouse over the Commandbutton, do you see an arrow (normal
mode)? or an arrow with direction arrows around it (design mode)?


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=549979




All times are GMT +1. The time now is 04:57 AM.

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