ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Workbook Opening in Certain Place (https://www.excelbanter.com/excel-discussion-misc-queries/150111-workbook-opening-certain-place.html)

Elise148

Workbook Opening in Certain Place
 
I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...

Barb Reinhardt

Workbook Opening in Certain Place
 
Try putting this code into the "ThisWorkbook" code

Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Activate
ThisWorkbook.Worksheets(1).Range("A1").Select
End Sub

HTH,
Barb Reinhardt

"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...


Mike H

Workbook Opening in Certain Place
 
Hi,

The replies you got from your previous post will work, have another look.

http://www.microsoft.com/office/comm...2-c22e3576ebec

"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...


Elise148

Workbook Opening in Certain Place
 
What is "ThisWorkbook" code?


"Barb Reinhardt" wrote:

Try putting this code into the "ThisWorkbook" code

Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Activate
ThisWorkbook.Worksheets(1).Range("A1").Select
End Sub

HTH,
Barb Reinhardt

"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...


Elise148

Workbook Opening in Certain Place
 
I tried those again...and I must be entering them in the wrong place. Where
do I enter them?

"Mike H" wrote:

Hi,

The replies you got from your previous post will work, have another look.

http://www.microsoft.com/office/comm...2-c22e3576ebec

"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...


Roger Govier

Workbook Opening in Certain Place
 
Hi Elise

Paste the following code into the ThisWorkBook module of your workbook

Private Sub Workbook_Open()
ThisWorkbook.Sheets("Sheet1").Select
Range("A1").Activate
End Sub

Press Alt + F11 to open the Visual Basic Editor
Ctrl + R to ensure the Project Explorer pane is visible.
Double click on this workbook, and paste the code into the large white
pane.
Alt + F11 again to return to Excel and Save the file.

Next time you open you will find the cursor located in A1 of Sheet1,
regardless of where it was at the point of saving.


--
Regards

Roger Govier


"Elise148" wrote in message
...
I posted something yesterday and the suggestions I got were good, but
they
did not work. What I want to do is everytime a workbook is opened,
have it be
opened to a certain place...A1 of the first sheet. I am not the one
that will
be using this spreadsheet, I'm just designing it, and I know that the
person
using it will not know to save it in A1 of the first sheet before
closing
it...how would I go about doing this...go about programming it into
VBA?

Thanks...




Mike H

Workbook Opening in Certain Place
 
Alt+F11 to open VB editor

On the right hand side select workbook from the dropdown and put then in
there.
select the Open event on the other dropdown and put it in there.

Mike

"Elise148" wrote:

I tried those again...and I must be entering them in the wrong place. Where
do I enter them?

"Mike H" wrote:

Hi,

The replies you got from your previous post will work, have another look.

http://www.microsoft.com/office/comm...2-c22e3576ebec

"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...


Barb Reinhardt

Workbook Opening in Certain Place
 
Roger, that will work as long as she doesn't change the worksheet name of
Sheet1 to something else.

"Roger Govier" wrote:

Hi Elise

Paste the following code into the ThisWorkBook module of your workbook

Private Sub Workbook_Open()
ThisWorkbook.Sheets("Sheet1").Select
Range("A1").Activate
End Sub

Press Alt + F11 to open the Visual Basic Editor
Ctrl + R to ensure the Project Explorer pane is visible.
Double click on this workbook, and paste the code into the large white
pane.
Alt + F11 again to return to Excel and Save the file.

Next time you open you will find the cursor located in A1 of Sheet1,
regardless of where it was at the point of saving.


--
Regards

Roger Govier


"Elise148" wrote in message
...
I posted something yesterday and the suggestions I got were good, but
they
did not work. What I want to do is everytime a workbook is opened,
have it be
opened to a certain place...A1 of the first sheet. I am not the one
that will
be using this spreadsheet, I'm just designing it, and I know that the
person
using it will not know to save it in A1 of the first sheet before
closing
it...how would I go about doing this...go about programming it into
VBA?

Thanks...





Roger Govier

Workbook Opening in Certain Place
 
Quite correct Barb.
Your code is better as it will work in all circumstances.

--
Regards

Roger Govier


"Barb Reinhardt" wrote in
message ...
Roger, that will work as long as she doesn't change the worksheet name
of
Sheet1 to something else.

"Roger Govier" wrote:

Hi Elise

Paste the following code into the ThisWorkBook module of your
workbook

Private Sub Workbook_Open()
ThisWorkbook.Sheets("Sheet1").Select
Range("A1").Activate
End Sub

Press Alt + F11 to open the Visual Basic Editor
Ctrl + R to ensure the Project Explorer pane is visible.
Double click on this workbook, and paste the code into the large
white
pane.
Alt + F11 again to return to Excel and Save the file.

Next time you open you will find the cursor located in A1 of Sheet1,
regardless of where it was at the point of saving.


--
Regards

Roger Govier


"Elise148" wrote in message
...
I posted something yesterday and the suggestions I got were good,
but
they
did not work. What I want to do is everytime a workbook is opened,
have it be
opened to a certain place...A1 of the first sheet. I am not the one
that will
be using this spreadsheet, I'm just designing it, and I know that
the
person
using it will not know to save it in A1 of the first sheet before
closing
it...how would I go about doing this...go about programming it into
VBA?

Thanks...







Elise148

Workbook Opening in Certain Place
 
Thanks everyone! I got it...


"Elise148" wrote:

I posted something yesterday and the suggestions I got were good, but they
did not work. What I want to do is everytime a workbook is opened, have it be
opened to a certain place...A1 of the first sheet. I am not the one that will
be using this spreadsheet, I'm just designing it, and I know that the person
using it will not know to save it in A1 of the first sheet before closing
it...how would I go about doing this...go about programming it into VBA?

Thanks...



All times are GMT +1. The time now is 04:28 AM.

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