Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Opening workbook on the same page every time

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Opening workbook on the same page every time

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Opening workbook on the same page every time

Hi Gord,

Sorry about the "page" slip up it wont happen again.

I am a newbie to code and macros (made a calendar that I'm excited about but
that's it so far) and I'm feeling pretty dumb right now but can you walk me
through it. I'm using 2007 so I first go into visual basic then on the left
it says "VBA Project (then the name of my workbook)" under that it lists all
of the worksheets. At the bottom it says "ThisWorkbook". I tried right
clicking in "ThisWorkbook" and inserting a module then pasted your code
there. It didn't work.

Am I in the right place?

Thanks

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Opening workbook on the same page every time

Me again,
I tried it again with your second code "Sheets(1).Activate. It worked this
time.

Thanks you so much for your help. I have learned from so many of your
answers in this website.

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Opening workbook on the same page every time

Double-click on ThisWorkbook which opens ThisWorkbook module ready for pasting
into.

Paste the code into that module.

No need to "insert module" which would not insert a module into ThisWorkbook but
just insert a new General module in the workbook/project


Gord

On Wed, 1 Aug 2007 17:22:03 -0700, Klee wrote:

Hi Gord,

Sorry about the "page" slip up it wont happen again.

I am a newbie to code and macros (made a calendar that I'm excited about but
that's it so far) and I'm feeling pretty dumb right now but can you walk me
through it. I'm using 2007 so I first go into visual basic then on the left
it says "VBA Project (then the name of my workbook)" under that it lists all
of the worksheets. At the bottom it says "ThisWorkbook". I tried right
clicking in "ThisWorkbook" and inserting a module then pasted your code
there. It didn't work.

Am I in the right place?

Thanks

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Opening workbook on the same page every time



"Klee" wrote:

Me again,
I tried it again with your second code "Sheets(1).Activate. It worked this
time.

Thanks you so much for your help. I have learned from so many of your
answers in this website.

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Opening workbook on the same page every time

Hi

That also worked for me, but now the buttons on my worksheet has been
disabled? What can I do to get it to work together?

"Klee" wrote:

Me again,
I tried it again with your second code "Sheets(1).Activate. It worked this
time.

Thanks you so much for your help. I have learned from so many of your
answers in this website.

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Opening workbook on the same page every time

Running that workbook_open code should not disable anything.

All it does is activate a sheet when you open the workbook.

What type of "buttons" are disabled?


Gord Dibben MS Excel MVP

On Thu, 4 Mar 2010 23:28:01 -0800, Leon
wrote:

Hi

That also worked for me, but now the buttons on my worksheet has been
disabled? What can I do to get it to work together?

"Klee" wrote:

Me again,
I tried it again with your second code "Sheets(1).Activate. It worked this
time.

Thanks you so much for your help. I have learned from so many of your
answers in this website.

"Gord Dibben" wrote:

In Thisworkbook module

Sub WorkBook_Open()
WorkSheets("TOC").Activate
End Sub

Or if you know the codename/number for the TOC sheet.

Can be found under Microsoft Excel Objects in VBE

Sheet1(TOC) or Sheet2(TOC)

Sub WorkBook_Open()
Sheets(1).Activate
End Sub

BTW............a worksheet is not a "page"............it is a worksheet.

A page is what you print out on your printer.


Gord Dibben MS Excel MVP


On Wed, 1 Aug 2007 16:12:10 -0700, Klee wrote:

I would like my workbook to open to the same page every time it gets opened.
I found the following code in another post he

Sub WorkBook_Open()
WorkSheets("Sheet1").Activate
End Sub

It doesn't work which means that I am doing something wrong. The sheet I
want it to open to is Sheet1 but I have renamed it TOC. I tried to paste it
into THIS WORKBOOK and I tried to paste it into TOC (both in microsoft excel
objects)

Does anyone know what I am doing wrong?
Thanks very much




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
opening a new page with hyperlinks in excel wassupdoc000 Excel Discussion (Misc queries) 3 June 30th 07 02:20 AM
Code for opening a workbook at a specific time!?! mike_vr Excel Discussion (Misc queries) 2 June 5th 07 04:55 PM
How to avoid opening an empty workbook every time I open a file? Nick Papadakis Setting up and Configuration of Excel 2 February 12th 06 11:55 AM
Opening a Title Page Ray Lloyd Excel Worksheet Functions 3 September 20th 05 03:29 PM
How do I print a one page spreadsheet multiple time, each with its own page number? lhsallwasser Excel Discussion (Misc queries) 4 August 17th 05 03:00 PM


All times are GMT +1. The time now is 02:50 AM.

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"