Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
NJS NJS is offline
external usenet poster
 
Posts: 6
Default left align active column/cell in window

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default left align active column/cell in window

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default left align active column/cell in window

Hi NJS

You could try something like the code below should help you out

[AA1].Activate
ColNumber = ActiveCell.Column
ActiveWindow.ScrollColumn = ColNumber

S

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default left align active column/cell in window

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default left align active column/cell in window

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   Report Post  
Posted to microsoft.public.excel.programming
NJS NJS is offline
external usenet poster
 
Posts: 6
Default left align active column/cell in window

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
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
Align Left and Right in Same Cell Sloth Excel Discussion (Misc queries) 6 April 25th 23 03:44 AM
Add "left align across selection" cell formatting Monty Analyst Excel Worksheet Functions 2 November 5th 08 03:17 PM
Align cell contents on left side of sheet? wannabe68 New Users to Excel 1 August 6th 07 09:03 PM
Left align '$' and right align numbers? skeetley Excel Discussion (Misc queries) 1 October 21st 05 08:12 AM
Select column cells to the left/right of active selection - an example [email protected] Excel Programming 1 March 24th 05 06:36 PM


All times are GMT +1. The time now is 01:12 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"