PC Review


Reply
Thread Tools Rate Thread

Auto Entering Dates Across Seven Worksheets and Navigating

 
 
Racqetsports@gmail.com
Guest
Posts: n/a
 
      15th Oct 2007
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

 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      15th Oct 2007
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

Racqetspo...@gmail.com 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


 
Reply With Quote
 
Racqetsports@gmail.com
Guest
Posts: n/a
 
      15th Oct 2007
That's awesome. Thanks JW.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
navigating between worksheets =?Utf-8?B?THVrZQ==?= Microsoft Excel Misc 1 10th Nov 2005 01:11 AM
RE: navigating between worksheets =?Utf-8?B?ZXhjZWx1c2VyZm9yZW1hbg==?= Microsoft Excel Misc 1 10th Nov 2005 12:36 AM
Auto filling dates on other worksheets with data from a next payme =?Utf-8?B?SklN?= Microsoft Excel Worksheet Functions 0 11th Feb 2005 04:59 PM
navigating between worksheets walter Microsoft Excel Misc 3 30th Mar 2004 10:26 PM
Entering Dates and auto-completing junior@invalid.com Microsoft Excel Programming 9 25th Feb 2004 10:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:58 PM.