Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
br549
 
Posts: n/a
Default increment/populate numbers by worksheet

I want to populate cell A1 in each worksheet in my workbook with a number
that increments by one every sheet. So A1 value in first worksheet would be
1; in second worksheet, 2 etc.

How?
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
maybe the following helps you:
http://www.dicks-blog.com/archives/2...eet/trackback/



--
Regards
Frank Kabel
Frankfurt, Germany
"br549" schrieb im Newsbeitrag
...
I want to populate cell A1 in each worksheet in my workbook with a number
that increments by one every sheet. So A1 value in first worksheet would
be
1; in second worksheet, 2 etc.

How?



  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

br

This code was originally written to increase a date in A1 across sheets.

Have re-written to increase a number across sheets. Left in the date
parts(commented) in case you ever wanted to use that.

Sub Date_Increment()
''increment a date in A1 across sheets
Dim myDate As Long 'Date
Dim iCtr As Long
myDate = 1 'DateSerial(2004, 4, 19)
For iCtr = 1 To Worksheets.Count
With Worksheets(iCtr).Range("A1")
.Value = myDate - 1 + iCtr
.NumberFormat = 0 ' "mm/dd/yyyy"
End With
Next iCtr
End Sub


Gord Dibben Excel MVP

On Tue, 4 Jan 2005 12:05:04 -0800, "br549"
wrote:

I want to populate cell A1 in each worksheet in my workbook with a number
that increments by one every sheet. So A1 value in first worksheet would be
1; in second worksheet, 2 etc.

How?


  #4   Report Post  
RagDyer
 
Posts: n/a
Default

If your sheets are the default XL names (Sheet1, Sheet2, ... etc.)
OR
You care to name them in such a way that the last character in the sheet
name is the "page" number, you could simply use this formula in A1 of each
sheet:

=RIGHT(CELL("filename",A1))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"br549" wrote in message
...
I want to populate cell A1 in each worksheet in my workbook with a number
that increments by one every sheet. So A1 value in first worksheet would be
1; in second worksheet, 2 etc.

How?

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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM
Linking items GREATER THAN O on another worksheet in the same Work Eddie Shapiro Excel Discussion (Misc queries) 4 December 1st 04 02:55 PM
Worksheet name and Backward compatibility Rich Excel Discussion (Misc queries) 3 November 30th 04 06:10 PM


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