Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default dates on worksheets

Since you have 31 sheets you may want to be doing other computations across
sheets.

This UDF can help with that.

Copy/paste this UDF to a general module in your workbook.

Function PrevSheet(rg As Range)
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function

Example of usage...................

Say you have 31 sheets, sheet1 through shee31...........sheet names don't
matter.

In sheet1 you have a formula in A10 =SUM(A1:A9)

Select second sheet and SHIFT + Click last sheet

In active sheet A10 enter =SUM(PrevSheet(A10),A1:A9)

Ungroup the sheets.

Each A10 will have the sum of the previous sheet's A10 plus the sum of the
current sheet's A1:A9

You could add your dates in the same manner.

Sheet1 A1 = 5/1/2010

Select sheets2 to 31 and in a cell enter

=PrevSheet(A1) + 1


Gord Dibben MS Excel MVP

On Thu, 29 Apr 2010 08:20:33 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

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


Gord Dibben MS Excel MVP

On Thu, 29 Apr 2010 07:59:02 -0700, Ann
wrote:

I want to type the date and day (05/01/2010 Sat) on my 31 sheets.
How can I type in the first day of the month and have each successive sheet
advance one day without typing it on each sheet individually?
Thanks so 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
Need help with 52 worksheets that need dates entered Susan Excel Discussion (Misc queries) 2 September 24th 09 07:53 PM
Sequential dates across worksheets Mick B Excel Discussion (Misc queries) 4 May 22nd 08 05:34 PM
changing dates in worksheets - help LEOPARDSHIDEAWAY Excel Discussion (Misc queries) 1 July 26th 07 10:06 PM
Moving dates between worksheets SuperDad Excel Discussion (Misc queries) 3 February 23rd 05 07:35 PM
how do i link dates between worksheets? brooke Excel Worksheet Functions 0 January 27th 05 05:45 AM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"