Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
does anyone know how I can set the column of the active cell to be leftmost in the window? When I activate a cell I need to see a specific range of columns starting from the active one. thank you, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right click on the sheet tab and select view code.
in the dropdowns at the top of the resulting module select Worksheet in the left dropdown and SelectionChange in the right dropdown (this is the default, so they may already be selected). Private Sub Worksheet_SelectionChange(ByVal Target As Range) End Sub will be in the module. Place this code between the entries Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveWindow.ScrollColumn = Target(1).Column End Sub -- Regards, Tom Ogilvy "NJS" wrote: Hi All, does anyone know how I can set the column of the active cell to be leftmost in the window? When I activate a cell I need to see a specific range of columns starting from the active one. thank you, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi NJS
You could try something like the code below should help you out [AA1].Activate ColNumber = ActiveCell.Column ActiveWindow.ScrollColumn = ColNumber S |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or to put the active cell in the top left corner
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.GoTo ActiveCell, True End Sub Mike "NJS" wrote: Hi All, does anyone know how I can set the column of the active cell to be leftmost in the window? When I activate a cell I need to see a specific range of columns starting from the active one. thank you, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
does anyone know how I can set the column of the active cell to be
leftmost in the window? When I activate a cell I need to see a specific range of columns starting from the active one. After you activate the cell, execute this... ActiveWindow.ScrollColumn = ActiveCell.Column ActiveWindow.ScrollRow = ActiveCell.Row Rick |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent! thanks Tom (ScrollColumn was the property I was looking for)
cheers. "Tom Ogilvy" wrote: Right click on the sheet tab and select view code. in the dropdowns at the top of the resulting module select Worksheet in the left dropdown and SelectionChange in the right dropdown (this is the default, so they may already be selected). Private Sub Worksheet_SelectionChange(ByVal Target As Range) End Sub will be in the module. Place this code between the entries Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveWindow.ScrollColumn = Target(1).Column End Sub -- Regards, Tom Ogilvy "NJS" wrote: Hi All, does anyone know how I can set the column of the active cell to be leftmost in the window? When I activate a cell I need to see a specific range of columns starting from the active one. thank you, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Align Left and Right in Same Cell | Excel Discussion (Misc queries) | |||
Add "left align across selection" cell formatting | Excel Worksheet Functions | |||
Align cell contents on left side of sheet? | New Users to Excel | |||
Left align '$' and right align numbers? | Excel Discussion (Misc queries) | |||
Select column cells to the left/right of active selection - an example | Excel Programming |