LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Tab Code Retrieve a Value

Im using tab code to zoom in on a cell when it is selected. Once the user
leaves the zoomed cell, I would like to return to the previous value of the
zoom property before it was set to 120.

For example€¦ the user is in cell A1 and they set the zoom value to 75. They
then select cell O22 and the zoom value is automatically set to 120. When
the leave cells O22, I would like to have the value of zoom set back to 75.

I realize I could set this manually with ActiveWindow.Zoom = 75, however,
most users have different zoom preferences, so I would like it to go back to
what they had set.

My code is below...

Thanks

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim a As Integer

a = ActiveWindow.Zoom
Range("a1").Value = a


If Target.Address = "$O$22" Then
ActiveWindow.Zoom = 120

ElseIf Target.Address = "$D$9:$E$9" Then
ActiveWindow.Zoom = 120

ElseIf Target.Address = "$C$19" Then
ActiveWindow.Zoom = 120

ElseIf Target.Address = "$C$21" Then
ActiveWindow.Zoom = 120

Else
ActiveWindow.Zoom = a
End If
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve Amin Excel Discussion (Misc queries) 1 April 23rd 10 01:54 PM
How to retrieve the value? Eric Excel Discussion (Misc queries) 3 November 25th 09 02:45 PM
VBA Code - Retrieve SQL 2000 data -Pivot Table george-v Excel Programming 0 February 5th 07 09:46 PM
How to retrieve the password for VBA code??? Lana[_4_] Excel Programming 2 November 3rd 04 11:17 PM
How to retrieve the password for VBA code??? Lana[_5_] Excel Programming 0 November 1st 04 03:47 PM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"