Home » Category » Microsoft Excel

Microsoft Excel: Zoom a range without actually selecting it

205| Fri, 23 May 2008 03:35:00 GMT| anonymous| Comments (2)
VBA newbie here (but learning quickly)

I am trying to zoom to a set of columns. (say G:M)

I am aware of:

Columns ("G:M").Select
ActiveWindow.Zoom = True

But I am trying to do it without actually using the 'select' command.
Let me explain:

I have a worksheet that has the Worksheet_SelectionChange function and
I am trying to have most of my code execute without having to disable
Application.EnableEvents every time I want to do something. I am able
to change cell vaues and properties without actually 'selecting' the
cells i.e. :

Range ("H9").Value = "hello"

or

Range("H9").Interior.ColorIndex = 8

If I use the Select command then one of my functions forces the acive
cell to column "A" and overrides the zoom area that I want. If Anyone
can tell me how to zoom to a set of columns without having to disable
events first it would be greatly appreciated.

Regards,

Jim

--
Staging2000
---
Staging2000's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31714
View this thread: http://www.excelforum.com/showthread.php?threadid=514168

Keywords & Tags: zoom, range, actually, selecting, microsoft, excel

URL: http://www.developertags.com/microsoft-excel/495167/
 
«« Prev - Next »» 2 helpful answers below.
Hello Jim,

This code example will zoom the ActiveWindow and move column "G" to the
left. The top row shown is row 10. On my screeen I used a zoom of 150%
to get columns "G" to "M" to fill the width of the screen. This is done
without selecting the columns first.

With ActiveWindow
.Zoom = 150
.ScrollColumn = 7
.ScrollRow = 10
End With

Sincerely,
Leith Ross
Leith Ross
---
Leith Ross's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=18465
View this thread: http://www.excelforum.com/showthread.php?threadid=514168

leith | Fri, 23 May 2008 03:36:00 GMT |

for my PC, I had to use zoom at 180%.
--
Regards,
Tom Ogilvy

"Leith Ross" <Leith.Ross.23i9qm_1140401402.7701...excelforum-nospam.com> wrote
in message news:Leith.Ross.23i9qm_1140401402.7701...excelforum-nospam.com...
> Hello Jim,
> This code example will zoom the ActiveWindow and move column "G" to the
> left. The top row shown is row 10. On my screeen I used a zoom of 150%
> to get columns "G" to "M" to fill the width of the screen. This is done
> without selecting the columns first.
> With ActiveWindow
> Zoom = 150
> ScrollColumn = 7
> ScrollRow = 10
> End With
>
> Sincerely,
> Leith Ross
>
> --
> Leith Ross
> ---
> Leith Ross's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=18465
> View this thread: http://www.excelforum.com/showthread.php?threadid=514168
>

tom | Fri, 23 May 2008 03:37:00 GMT |

Microsoft Excel Hot Answers

Microsoft Excel New questions

Microsoft Excel Related Categories