View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Running code from userform

You need to load the form into memory, but not show it.

Sub AAA()
Load UserForm1
UserForm1.CommandButton1_Click
End Sub

In the userform's code module, change the command button's Click
procedure from Private to Public.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com





On Tue, 11 May 2010 12:25:01 -0700, ordnance1
wrote:

Is it possible to run the code assigned to commandbutton1 on userform1
without opening the userform?