PDA

View Full Version : Solved: zoom sheet on background



danovkos
08-05-2010, 06:43 AM
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

slamet Harto
08-05-2010, 07:51 AM
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


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

danovkos
08-05-2010, 11:27 PM
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.

p45cal
08-06-2010, 12:12 AM
But without to switching in sheet 2.No. Zoom works on the active window. Try this, it's hardly noticeable: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

danovkos
08-06-2010, 02:07 AM
Ok,
this your code is just a little bit better as my previous, so i will use it.
Thank you for your help.