View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jason Zischke Jason Zischke is offline
external usenet poster
 
Posts: 147
Default Running a Marcro when sheet is opened

Try This :

Private Sub Worksheet_Activate()

Jason Zischke

"Mark Dullingham" wrote:

I recorde a simple macro to hide all the blank cells in a sheet and pasted
into the code of a command button as follws:

Private Sub CommandButton1_Click()
Range("B6:K425").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<"
End Sub

What I would like to do is have this macro apply when the sheet is opened
but I don't know what to enter after the 'Private Sub' bit instead of
CommandButton1_Click().

Can anyone help please.

Thanks a plenty in advance.