Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
leah
 
Posts: n/a
Default Worksheet numbering

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Worksheet numbering

You can do it--but remember that the value doesn't get saved if the workbook is
closed without saving.

And lots of times, people open the wrong workbook and close it immediately.

But if you add this code to a General module of your workbook's project:

Option Explicit
Sub auto_open()

With ThisWorkbook.Worksheets("sheet1").Range("a1")
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
.Value = 1 'start again??
End If
End With

ThisWorkbook.Save

End Sub

It adds one to the cell and saves the file--well if macros are running when the
user opens the workbook.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

leah wrote:

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
leah
 
Posts: n/a
Default Worksheet numbering

I am really sorry but I don't understand what I have to do to get it to work.
Please could you explain again in laymans terms?

Thanks


"Dave Peterson" wrote:

You can do it--but remember that the value doesn't get saved if the workbook is
closed without saving.

And lots of times, people open the wrong workbook and close it immediately.

But if you add this code to a General module of your workbook's project:

Option Explicit
Sub auto_open()

With ThisWorkbook.Worksheets("sheet1").Range("a1")
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
.Value = 1 'start again??
End If
End With

ThisWorkbook.Save

End Sub

It adds one to the cell and saves the file--well if macros are running when the
user opens the workbook.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

leah wrote:

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Marcelo
 
Posts: n/a
Default Worksheet numbering

hi, press ALT+F11, copy and paste the module that Dave gave you.

hope this helps
Regards from Brazil - going to the 6th
Marcelo

"leah" escreveu:

I am really sorry but I don't understand what I have to do to get it to work.
Please could you explain again in laymans terms?

Thanks


"Dave Peterson" wrote:

You can do it--but remember that the value doesn't get saved if the workbook is
closed without saving.

And lots of times, people open the wrong workbook and close it immediately.

But if you add this code to a General module of your workbook's project:

Option Explicit
Sub auto_open()

With ThisWorkbook.Worksheets("sheet1").Range("a1")
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
.Value = 1 'start again??
End If
End With

ThisWorkbook.Save

End Sub

It adds one to the cell and saves the file--well if macros are running when the
user opens the workbook.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

leah wrote:

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
leah
 
Posts: n/a
Default Worksheet numbering

I have followed your instructions but still nothing is happening. I am
relatively new to formulas and therefore do not understand fully what I need
to do. Any additional help would be much appreciated.

"Marcelo" wrote:

hi, press ALT+F11, copy and paste the module that Dave gave you.

hope this helps
Regards from Brazil - going to the 6th
Marcelo

"leah" escreveu:

I am really sorry but I don't understand what I have to do to get it to work.
Please could you explain again in laymans terms?

Thanks


"Dave Peterson" wrote:

You can do it--but remember that the value doesn't get saved if the workbook is
closed without saving.

And lots of times, people open the wrong workbook and close it immediately.

But if you add this code to a General module of your workbook's project:

Option Explicit
Sub auto_open()

With ThisWorkbook.Worksheets("sheet1").Range("a1")
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
.Value = 1 'start again??
End If
End With

ThisWorkbook.Save

End Sub

It adds one to the cell and saves the file--well if macros are running when the
user opens the workbook.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

leah wrote:

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?

--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Worksheet numbering

This is a macro that runs each time the workbook is opened. So if you've set it
up ok, then you'll have to close and reopen the workbook to see the results.

If you're having trouble setting it up, make sure you read David McRitchie's
notes.

leah wrote:

I have followed your instructions but still nothing is happening. I am
relatively new to formulas and therefore do not understand fully what I need
to do. Any additional help would be much appreciated.

"Marcelo" wrote:

hi, press ALT+F11, copy and paste the module that Dave gave you.

hope this helps
Regards from Brazil - going to the 6th
Marcelo

"leah" escreveu:

I am really sorry but I don't understand what I have to do to get it to work.
Please could you explain again in laymans terms?

Thanks


"Dave Peterson" wrote:

You can do it--but remember that the value doesn't get saved if the workbook is
closed without saving.

And lots of times, people open the wrong workbook and close it immediately.

But if you add this code to a General module of your workbook's project:

Option Explicit
Sub auto_open()

With ThisWorkbook.Worksheets("sheet1").Range("a1")
If IsNumeric(.Value) Then
.Value = .Value + 1
Else
.Value = 1 'start again??
End If
End With

ThisWorkbook.Save

End Sub

It adds one to the cell and saves the file--well if macros are running when the
user opens the workbook.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

leah wrote:

Is it possible to number a working sheet and have that number automatically
change each time the excel document is opened?

--

Dave Peterson


--

Dave Peterson
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
Numbering rows in a worksheet slenhart Excel Worksheet Functions 1 May 24th 06 04:56 PM
Retrieve data from all of the worksheet within the file dannyboy213 Excel Worksheet Functions 1 March 22nd 06 06:51 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


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