Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with scroll area and autofit

Status
Not open for further replies.

ribhead

Technical User
Jun 2, 2003
384
US
I made a scroll bar user form and it works failry well other than two issues: I can't get the columns to autofit and the second sheet won't scroll down to the last row.

Private Sub CommandButton10_Click() ' to production log
Me.Hide
Unload Me
Worksheets("Production Log").Activate
Columns("A:Z").EntireColumn.AutoFit
lastrow = Cells(1, 1).End(xlDown).Row
ActiveSheet.ScrollArea = Range(Cells(1, 1), Cells(lastrow, 26)).Address
UserForm6.Show
End Sub

Private Sub CommandButton9_Click() 'To scrap log
Me.Hide
Unload Me
Worksheets("Scrap Log").Activate
Columns("A:H").EntireColumn.AutoFit
lastrow = Cells(1, 1).End(xlDown).Row
With ActiveSheet
.ScrollArea = Range(Cells(4, 1), Cells(lastrow, 8)).Address
End With
UserForm6.Show
End Sub

Any help would be very very appreciated!!!


For just $19.95 you too can have a beautiful smile.
 
I did forget one thing on my Userform I have a zoom control. I just found out that if I disable the zoom control I am then able to autofit. Why is that? Is there a way around this? Anyone out there. He said as a tumbleweed rolled across the dusty plains.

For just $19.95 you too can have a beautiful smile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top