Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Cell Position

Hi
I run this line of code at the end of a procedure to activate first blank
cell in column B.

Cells(8, 2).End(xlDown).Offset(1, 0).Select

Depending where you are in the sheet the cell activated could be at the top
or bottom of the screen.
or
This line of code will always position active cell at top left and in my
situation €śhide€ť column A.
Application.Goto Reference:=Range(ActiveCell.Address), Scroll:=True

How can I have the active column B cell in the vertical centre of screen and
Column A still visible, when number of rows are passed the centre?

--
Thank you

Regards

Bob C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Cell Position

Dim cRow As Long

cRow = Cells(8, 2).End(xlDown).Offset(1, 0).Row
Application.Goto Reference:=Range("A" & cRow), Scroll:=True
ActiveCell.Offset(0, 1).Select


--

HTH

RP

"Robert Christie" wrote in message
...
Hi
I run this line of code at the end of a procedure to activate first blank
cell in column B.

Cells(8, 2).End(xlDown).Offset(1, 0).Select

Depending where you are in the sheet the cell activated could be at the

top
or bottom of the screen.
or
This line of code will always position active cell at top left and in my
situation "hide" column A.
Application.Goto Reference:=Range(ActiveCell.Address), Scroll:=True

How can I have the active column B cell in the vertical centre of screen

and
Column A still visible, when number of rows are passed the centre?

--
Thank you

Regards

Bob C



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Cell Position

Hi Bob

You code "unhide" column A but did not position active cell in centre of
screen.
I've modified your code to achieve this, but it will only work if number of
rows containing data is more than 25.
It's a bit messy jumping up and down the screen, plus you have to know in
advance the total number of rows appearing on screen.

cRow = Cells(8, 2).End(xlDown).Offset(-25, 0).Row
Application.Goto Reference:=Range("A" & cRow), Scroll:=True
ActiveCell.Offset(26, 1).Select

Thank you

Regards

Bob C.


"Bob Phillips" wrote:

Dim cRow As Long

cRow = Cells(8, 2).End(xlDown).Offset(1, 0).Row
Application.Goto Reference:=Range("A" & cRow), Scroll:=True
ActiveCell.Offset(0, 1).Select


--

HTH

RP

"Robert Christie" wrote in message
...
Hi
I run this line of code at the end of a procedure to activate first blank
cell in column B.

Cells(8, 2).End(xlDown).Offset(1, 0).Select

Depending where you are in the sheet the cell activated could be at the

top
or bottom of the screen.
or
This line of code will always position active cell at top left and in my
situation "hide" column A.
Application.Goto Reference:=Range(ActiveCell.Address), Scroll:=True

How can I have the active column B cell in the vertical centre of screen

and
Column A still visible, when number of rows are passed the centre?

--
Thank you

Regards

Bob C




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
Changing position of last used cell Graham Brown Excel Discussion (Misc queries) 0 December 2nd 11 09:09 AM
VBA position of char in cell Jack Sons Excel Discussion (Misc queries) 2 September 1st 09 01:15 AM
Displaying a cell relative to the position to another cell Tibbs Excel Discussion (Misc queries) 2 July 21st 06 08:28 AM
Current cell position AJPendragon Excel Worksheet Functions 1 February 3rd 06 04:28 PM
Position of Cell on Screen pjhageman[_2_] Excel Programming 1 January 10th 04 07:36 PM


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