Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default vba code to get an duse the value from a particular cell

Using xl2003, I have the following Worksheet Selection Change code:

If Target.Column = 5 Then
Target.Columns.ColumnWidth = 27.11
ActiveWindow.Zoom = 85
Else
Columns(5).ColumnWidth = 3.78
'ActiveWindow.Zoom = 75
End If

I would like to be able to change the values zoom 85 and 75 to
correspond to the values in 2 cells, for eample, Notes!B5 and Notes!
B6, so the zoom factors can be set as needed. How can this be done?

As always,

Thanks,

Tonso
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default vba code to get an duse the value from a particular cell

If Target.Cells.Count 1 Then Exit Sub

If Target(1,1).Address = $B$5 Then ActiveWindow.Zoom = 85

If Target(1,1).Address = $B$6 Then ActiveWindow.Zoom = 75



"Tonso" wrote in message
...
Using xl2003, I have the following Worksheet Selection Change code:

If Target.Column = 5 Then
Target.Columns.ColumnWidth = 27.11
ActiveWindow.Zoom = 85
Else
Columns(5).ColumnWidth = 3.78
'ActiveWindow.Zoom = 75
End If

I would like to be able to change the values zoom 85 and 75 to
correspond to the values in 2 cells, for eample, Notes!B5 and Notes!
B6, so the zoom factors can be set as needed. How can this be done?

As always,

Thanks,

Tonso


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default vba code to get an duse the value from a particular cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
Target.Columns.ColumnWidth = 27.11
ActiveWindow.Zoom = Sheets("Notes").Range("B5") '85
Else
Columns(5).ColumnWidth = 3.78
ActiveWindow.Zoom = Sheets("Notes").Range("B6") '75
End If
End Sub


Gord Dibben MS Excel MVP

On Tue, 30 Mar 2010 15:26:44 -0700 (PDT), Tonso
wrote:

Using xl2003, I have the following Worksheet Selection Change code:

If Target.Column = 5 Then
Target.Columns.ColumnWidth = 27.11
ActiveWindow.Zoom = 85
Else
Columns(5).ColumnWidth = 3.78
'ActiveWindow.Zoom = 75
End If

I would like to be able to change the values zoom 85 and 75 to
correspond to the values in 2 cells, for eample, Notes!B5 and Notes!
B6, so the zoom factors can be set as needed. How can this be done?

As always,

Thanks,

Tonso


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default vba code to get an duse the value from a particular cell

On Mar 30, 6:47*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 5 Then
* * * *Target.Columns.ColumnWidth = 27.11
* * * *ActiveWindow.Zoom = Sheets("Notes").Range("B5") *'85
* *Else
* * * *Columns(5).ColumnWidth = 3.78
* * * *ActiveWindow.Zoom = Sheets("Notes").Range("B6") *'75
* *End If
End Sub

Gord Dibben *MS Excel MVP

On Tue, 30 Mar 2010 15:26:44 -0700 (PDT), Tonso
wrote:



Using xl2003, I have the following Worksheet Selection Change code:


If Target.Column = 5 Then
* * * Target.Columns.ColumnWidth = 27.11
* * * ActiveWindow.Zoom = 85
* Else
* * * Columns(5).ColumnWidth = 3.78
* * * 'ActiveWindow.Zoom = 75
* End If


I would like to be able to change the values zoom 85 and 75 to
correspond to the values in 2 cells, for eample, Notes!B5 and Notes!
B6, so the zoom factors can be set as needed. How can this be done?


As always,


Thanks,


Tonso- Hide quoted text -


- Show quoted text -


As always, Thanks so much Gord

Tonso
Reply
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Excel Discussion (Misc queries) 0 June 26th 09 06:01 PM
VBA Code when a cell is selected [email protected] Excel Discussion (Misc queries) 3 June 13th 07 08:50 PM
add code to a cell via macro mithu Excel Discussion (Misc queries) 1 April 19th 07 09:14 PM


All times are GMT +1. The time now is 03:54 PM.

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

About Us

"It's about Microsoft Excel"