ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   forcing the opening cell to open at top? (https://www.excelbanter.com/excel-programming/355978-forcing-opening-cell-open-top.html)

krisrice

forcing the opening cell to open at top?
 

Ok...I have used the following code to open a new workbook and go to a
spacific cell..it works fine to get to it..but is it possible to make
it open with that cell at the top? I have a frozen column headings so
not sure how to go about it..

Sub Macro2002047()
ChDir "N:\Storage list"
Workbooks.Open Filename:="N:\Storage list\Water and Sewer
details.xls"
Range("A106").Select
Windows("Water and Sewer details.xls").Activate
End Sub

I'm new to the macro world so please help...Ohh..it is Excel 2003 on
Windows XP if you need that...

Kris


--
krisrice
------------------------------------------------------------------------
krisrice's Profile: http://www.excelforum.com/member.php...o&userid=32450
View this thread: http://www.excelforum.com/showthread...hreadid=522237


Tom Ogilvy

forcing the opening cell to open at top?
 
Use the Workbook_Open event to run you macro.

See Chip Pearson's page on Events for a overview:

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"krisrice" wrote:


Ok...I have used the following code to open a new workbook and go to a
spacific cell..it works fine to get to it..but is it possible to make
it open with that cell at the top? I have a frozen column headings so
not sure how to go about it..

Sub Macro2002047()
ChDir "N:\Storage list"
Workbooks.Open Filename:="N:\Storage list\Water and Sewer
details.xls"
Range("A106").Select
Windows("Water and Sewer details.xls").Activate
End Sub

I'm new to the macro world so please help...Ohh..it is Excel 2003 on
Windows XP if you need that...

Kris


--
krisrice
------------------------------------------------------------------------
krisrice's Profile: http://www.excelforum.com/member.php...o&userid=32450
View this thread: http://www.excelforum.com/showthread...hreadid=522237



David

forcing the opening cell to open at top?
 
krisrice wrote


Ok...I have used the following code to open a new workbook and go to a
spacific cell..it works fine to get to it..but is it possible to make
it open with that cell at the top? I have a frozen column headings so
not sure how to go about it..

Sub Macro2002047()
ChDir "N:\Storage list"
Workbooks.Open Filename:="N:\Storage list\Water and Sewer
details.xls"
Range("A106").Select
Windows("Water and Sewer details.xls").Activate
End Sub

I'm new to the macro world so please help...Ohh..it is Excel 2003 on
Windows XP if you need that...

Kris



While Tom's .Select suggestion in Workbook_Open() will highlight that cell,
it won't actually make A106 the top left cell immediately under your
headings. Use this instead:
Application.GoTo Range("A106"), True

--
David

Tom Ogilvy

forcing the opening cell to open at top?
 
Tom didn't suggest selecting. Tom suggested using the workbook_open event.

--
Regards,
Tom Ogilvy


"David" wrote:

krisrice wrote


Ok...I have used the following code to open a new workbook and go to a
spacific cell..it works fine to get to it..but is it possible to make
it open with that cell at the top? I have a frozen column headings so
not sure how to go about it..

Sub Macro2002047()
ChDir "N:\Storage list"
Workbooks.Open Filename:="N:\Storage list\Water and Sewer
details.xls"
Range("A106").Select
Windows("Water and Sewer details.xls").Activate
End Sub

I'm new to the macro world so please help...Ohh..it is Excel 2003 on
Windows XP if you need that...

Kris



While Tom's .Select suggestion in Workbook_Open() will highlight that cell,
it won't actually make A106 the top left cell immediately under your
headings. Use this instead:
Application.GoTo Range("A106"), True

--
David


David

forcing the opening cell to open at top?
 
?B?VG9tIE9naWx2eQ==?= wrote

Tom didn't suggest selecting. Tom suggested using the workbook_open
event.


Literally true. Since that was the limit of the suggestion, I assumed he
expected the OP's existing related line be placed there, or existing Sub be
called from there.

--
David

krisrice[_2_]

forcing the opening cell to open at top?
 

Thanks for all the help...it works like a charm with the
Use this instead:
Application.GoTo Range("A106"), True


kri

--
krisric
-----------------------------------------------------------------------
krisrice's Profile: http://www.excelforum.com/member.php...fo&userid=3245
View this thread: http://www.excelforum.com/showthread.php?threadid=52223



All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com