View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Qaspec Qaspec is offline
external usenet poster
 
Posts: 96
Default Problem with Auto Fit Sub on open

I have the follwoign code to Sort a column on a worksheet and resize to
autofit but I keep getting run time error 1004. Any Advice?

Private Sub Workbook_Open()

Worksheets("Inquiry").Range("A2:B100").Sort _
Key1:=Worksheets("Inquiry").Range("A2"), _
Key2:=Worksheets("Inquiry").Range("B100")


Worksheets("Inquiry").Range("B2:B100").Rows.AutoFi t


End Sub