Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Auto Entering Dates Across Seven Worksheets and Navigating

Hello there,
In a workbook with 7 sheets (named Period 1, Period 2, ..., Period 7), I
would like to attach code to a macro that does the following:

1.) Go to the sheet named Period 1,

2.) Find the last used cell in row 12,

3.) Insert today's date into the next cell to the right (formatted mm/
dd/yy).

4.) Do this to all of the sheets whose name starts with "Period."

5.) Lastly, put the cursor 3 cells below the newly entered date on
the sheet named Period 1.

Thank you very much for any and all help on this code.
Tracy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Auto Entering Dates Across Seven Worksheets and Navigating

Sub this()
Dim ws As Worksheet, lCol As Integer, r As Long
r = 12
For Each ws In ActiveWorkbook.Worksheets
With ws
If Left(.Name, 6) = "Period" Then
lCol = .Cells(r, "IV") _
.End(xlToLeft).Column + 1
.Cells(r, lCol).NumberFormat = _
"mm/dd/yy;@"
.Cells(r, lCol).Value = Date
If .Name = "Period 1" Then _
Application.Goto .Cells(r + 3, lCol)
End If
End With
Next ws
End Sub

wrote:
Hello there,
In a workbook with 7 sheets (named Period 1, Period 2, ..., Period 7), I
would like to attach code to a macro that does the following:

1.) Go to the sheet named Period 1,

2.) Find the last used cell in row 12,

3.) Insert today's date into the next cell to the right (formatted mm/
dd/yy).

4.) Do this to all of the sheets whose name starts with "Period."

5.) Lastly, put the cursor 3 cells below the newly entered date on
the sheet named Period 1.

Thank you very much for any and all help on this code.
Tracy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Auto Entering Dates Across Seven Worksheets and Navigating

That's awesome. Thanks JW.

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
navigating between worksheets Luke Excel Discussion (Misc queries) 1 November 10th 05 01:11 AM
Navigating among worksheets Phil Hageman[_4_] Excel Programming 10 January 10th 05 03:15 PM
Navigating between worksheets. shazza Excel Worksheet Functions 1 November 4th 04 12:19 AM
Entering Dates and auto-completing [email protected] Excel Programming 7 February 25th 04 10:07 PM
Navigating between worksheets mar Excel Programming 5 October 14th 03 02:21 PM


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