PDA

View Full Version : [SOLVED] Zoom to used range



gibbo1715
02-12-2005, 10:43 AM
is it possible to set the zoom to the used range?

mdmackillop
02-12-2005, 11:06 AM
A liitle simpler


Sub ZoomUR()
Dim Tmp As String
Tmp = ActiveCell.Address
ActiveSheet.UsedRange.Select
ActiveWindow.Zoom = True
Range(Tmp).Select
End Sub

gibbo1715
02-12-2005, 11:13 AM
Thanks had a feeling you d be able to answer my question

mdmackillop
02-12-2005, 11:15 AM
It occurred to me how useful this function is, so here's a toggle version between 100 and the used range.



Sub ZoomUR()
Dim Tmp As String
If ActiveWindow.Zoom <> 100 Then
ActiveWindow.Zoom = 100
Else
Tmp = ActiveCell.Address
ActiveSheet.UsedRange.Select
ActiveWindow.Zoom = True
Range(Tmp).Select
End If
End Sub