View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
sarndt sarndt is offline
external usenet poster
 
Posts: 37
Default Userform Command Button

I tried changing it to Public and that didn't work. And Application.Run only
appears to work with a macro.

"Robert Crandal" wrote:

Maybe it's because most subroutines in a userform module
are "Private"??? Have you tried changing the "Private"
prefix to "Public" for the D?_Click subroutines?? Maybe
that might fix it......

Also, im not entirely sure if changing routines from Private
to Public is a good idea for userform subroutines. Maybe
you can place your D?_Click code in a normal module
instead???


"sarndt" wrote in message
...
In a Userform, I have multiple command buttons. For example:

D1_Click
D2_Click

Depending on another event that occurs, I want to calculate in code the
button name that I will be triggering the click event and then trigger the
event.

For example Application.Run "D" & i & "_Click"

with i being the value of 1 or 2.

Application.Run doesn't appear to work in the Userform.

Thanks

Steve


.