Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Private Sub() - Sub()
Hi,
I know only "record macro" way, then I edit that recorded macro. And I see that they always start Sub() I sometimes see in your solutions macros starting as "Private Sub..." How do we run such macros ? Thanks, Cousin Excel |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Private Sub() - Sub()
"CousinExcel" wrote:
I sometimes see in your solutions macros starting as "Private Sub..." How do we run such macros ? Usually, such subroutines (and functions) are not intended to be executed directly. They might be routines that support public routines, i.e. routines that __are__ intended to executed directly. But you can always go into VBA (press alt+F11), select the macro, and press F5. You should not do that unless you know that the macro is intended to be executed in that way. I posted a Private Sub by mistake recently. I had intended to remove the word Private. Sometimes I have multiple experimental macros in different modules. Lacking imagination, I might call all of them doit(). So I use the Private feature to ensure that VBA does not get confused and raise an error. I don't need to execute them from Excel because I am doing all my work in VBA. ----- original message ----- "CousinExcel" wrote: Hi, I know only "record macro" way, then I edit that recorded macro. And I see that they always start Sub() I sometimes see in your solutions macros starting as "Private Sub..." How do we run such macros ? Thanks, Cousin Excel |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Private Sub() - Sub()
This is done so they won't be seen. Goto the editor to fire.
-- Don Guillett Microsoft MVP Excel SalesAid Software "CousinExcel" wrote in message ... Hi, I know only "record macro" way, then I edit that recorded macro. And I see that they always start Sub() I sometimes see in your solutions macros starting as "Private Sub..." How do we run such macros ? Thanks, Cousin Excel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Private Sub Workbook_Open() doesn't run | Excel Discussion (Misc queries) | |||
Private sub problem | Excel Worksheet Functions | |||
Private Sub CommandButton1_Click() | Excel Discussion (Misc queries) | |||
Common Private Sub | Excel Discussion (Misc queries) | |||
Private sub | New Users to Excel |