Hello,
Is there any in Excel of inserting a date into a document when you open it?
Regards
Justin
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Auto Date command? (2000)
(Edited by sdckapr on 06-Apr-04 09:03. Added addtional comments)
Is the file named ‘IncomingPCMs.xls” open?
Does that file have a macro named Macro4?
Also, if it is not open, does excel know its location so it can open it?
If you assigned it to a button, where does the button thing the macro is located (macro name, file name, pathname, drive letter)?
Steve
This appears to work fine.
I have now created a macro to output the date and some text but it only works on 1 row.
Any ideas as to what l am doing wrong?
If l press on the macro it works fine for the first time but only displays the date when l press on it a second time in another row. The text in columns 4,5, & 6 is not displayed for some odd reason.
see attachment.
Justin
Not without seeing your macro. Could you post the code, and tell us what you expect or want it to do, and what it does or does not do as the case may be.
it is better to attach a file rather than screen shot as it gives us more info. A screen shot is best when you want to “capture” an error message, not for giving us information.
Steve
What l would like the macro to do is to output the date in the 1st column and words “Submission…” in the 4th Column and the words “Gail” in the 5th and “Mr..” in the 6th,
Justin
——-
‘
ActiveCell.FormulaR1C1 = “=TODAY()”
Range(“E466:G466”).Select
Selection.Copy
Range(“E467:G467”).Select
ActiveSheet.Paste
Range(“I467”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub Incoming_pcm()
‘
‘ Incoming_pcm Macro
‘ Macro recorded 06/04/2004 by jjr
‘
‘
Range(“E466:G466”).Select
Selection.Copy
Range(“E467:G467”).Select
ActiveSheet.Paste
Range(“I467”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub Macro11()
‘
‘ Macro11 Macro
‘ Macro recorded 06/04/2004 by jjr
‘
‘
ActiveCell.FormulaR1C1 = “=TODAY()”
Range(“E467:G467”).Select
Selection.Copy
Range(“E468:G468”).Select
ActiveSheet.Paste
Range(“I468”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
I don’t understand exactly why you need the macro. It seems like you could do it by copy and paste.
This will take the items from cos 4,5,6 of row 466 (change as desired) and put it into cols 4,5,6 of the rows that are selected. Also col 1 of the rows you select will have the formula = today()
Steve
Option Explicit Sub jj1234Macro() Dim rng As Range Dim lRow As Long Dim lSourceRow As Long Dim x As Integer lSourceRow = 466 Set rng = Selection.EntireRow For lRow = 1 To rng.Rows.Count rng.Cells(lRow, 1).Formula = "=Today()" For x = 4 To 6 rng.Cells(lRow, x) = Cells(lSourceRow, x) Next Next End Sub
I don’t understand exactly why you need the macro. It seems like you could do it by copy and paste.
This will take the items from cos 4,5,6 of row 466 (change as desired) and put it into cols 4,5,6 of the rows that are selected. Also col 1 of the rows you select will have the formula = today()
Steve
Option Explicit Sub jj1234Macro() Dim rng As Range Dim lRow As Long Dim lSourceRow As Long Dim x As Integer lSourceRow = 466 Set rng = Selection.EntireRow For lRow = 1 To rng.Rows.Count rng.Cells(lRow, 1).Formula = "=Today()" For x = 4 To 6 rng.Cells(lRow, x) = Cells(lSourceRow, x) Next Next End Sub
What l would like the macro to do is to output the date in the 1st column and words “Submission…” in the 4th Column and the words “Gail” in the 5th and “Mr..” in the 6th,
Justin
——-
‘
ActiveCell.FormulaR1C1 = “=TODAY()”
Range(“E466:G466”).Select
Selection.Copy
Range(“E467:G467”).Select
ActiveSheet.Paste
Range(“I467”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub Incoming_pcm()
‘
‘ Incoming_pcm Macro
‘ Macro recorded 06/04/2004 by jjr
‘
‘
Range(“E466:G466”).Select
Selection.Copy
Range(“E467:G467”).Select
ActiveSheet.Paste
Range(“I467”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub Macro11()
‘
‘ Macro11 Macro
‘ Macro recorded 06/04/2004 by jjr
‘
‘
ActiveCell.FormulaR1C1 = “=TODAY()”
Range(“E467:G467”).Select
Selection.Copy
Range(“E468:G468”).Select
ActiveSheet.Paste
Range(“I468”).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Not without seeing your macro. Could you post the code, and tell us what you expect or want it to do, and what it does or does not do as the case may be.
it is better to attach a file rather than screen shot as it gives us more info. A screen shot is best when you want to “capture” an error message, not for giving us information.
Steve
This appears to work fine.
I have now created a macro to output the date and some text but it only works on 1 row.
Any ideas as to what l am doing wrong?
If l press on the macro it works fine for the first time but only displays the date when l press on it a second time in another row. The text in columns 4,5, & 6 is not displayed for some odd reason.
see attachment.
Justin
(Edited by sdckapr on 06-Apr-04 09:03. Added addtional comments)
Is the file named ‘IncomingPCMs.xls” open?
Does that file have a macro named Macro4?
Also, if it is not open, does excel know its location so it can open it?
If you assigned it to a button, where does the button thing the macro is located (macro name, file name, pathname, drive letter)?
Steve
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications