Consulting

Results 1 to 5 of 5

Thread: Solved: zoom sheet on background

  1. #1

    Solved: zoom sheet on background

    Hi all
    is it possible to zoom (adjust) sheet view on the background. I mean, sheet "start" will be selected and sheet "ALL" will be zoomed on background.
    I tried this, but was not successfull
    thx for help

    Sub testtt()
    Dim rngSaveActiveCell As Range
    Dim pval, pvall2 As String
    Dim PrehladyCesta As String
    Dim a As Integer
     
        With Sheets("ALL")
        With Range("B1")
                ' Set rngSaveActiveCell = ActiveCell
     
                Set rngSaveActiveCell = Sheets("ALL").Range("B1")
                Application.ScreenUpdating = False
                Sheets("ALL").Zoom = Columns("A:C").Select
                ' rngSaveActiveCell.Select
                Application.ScreenUpdating = True
            ActiveSheet.Unprotect
             '  If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
    '        ActiveSheet.Protect
        End With
    End With
    End Sub

  2. #2
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    Apologise, I don't fully understood what you mean :" sheet "start" will be selected and sheet "ALL" will be zoomed on background."

    You can't see two sheets together, however just try this

    [VBA]
    If Target.Column = 1 Or Target.Column = 2 Or Target.Column = 3 Then
    ActiveWindow.Zoom = 150
    Else
    ActiveWindow.Zoom = 80
    End If

    [/VBA]

  3. #3
    thx for try.
    but this do exactly what my code did.

    What i mean is.

    You have wb with e.g. with 2 sheets. You work in sheet 1 and here you have button with this "zoom" code. You push it and i want, that in sheet 2 will adjust screen to A:J. But without to switching in sheet 2. You will all the time (during macro is running) in sheet 1. And when macro has finished, you select sheet2 and screen(columns) will be adjusted to A:J.

    I dont know if am i clear and if is it possible.
    thx for patience.

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Quote Originally Posted by danovkos
    But without to switching in sheet 2.
    No. Zoom works on the active window. Try this, it's hardly noticeable:[vba]Sub blah()
    Application.ScreenUpdating = False
    Set ws = ActiveSheet
    Application.Goto Sheets("ALL").Range("A1:J1")
    ActiveWindow.Zoom = True
    Range("A1").Select
    ws.Activate
    Application.ScreenUpdating = True
    End Sub
    [/vba]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    Ok,
    this your code is just a little bit better as my previous, so i will use it.
    Thank you for your help.

Posting Permissions

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