Consulting

Results 1 to 4 of 4

Thread: Zoom to used range

  1. #1
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location

    Zoom to used range

    is it possible to set the zoom to the used range?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    A liitle simpler

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

  3. #3
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Thanks had a feeling you d be able to answer my question

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •