2 worksheet open, one is macro coding and the other one is being coded.
How do I code date and time on another sheet. Alternative to code below.
Range("A2").Select ActiveCell.FormulaR1C1 = "=NOW()"
2 worksheet open, one is macro coding and the other one is being coded.
How do I code date and time on another sheet. Alternative to code below.
Range("A2").Select ActiveCell.FormulaR1C1 = "=NOW()"
You will have to replace the workbook and worksheet with the proper reference
Workbook.Worksheet.Range("A2").Value = Now
Change the sheet name to suit.
Sheets("Sheet2").Range("A2").FormulaR1C1 = "=NOW()"
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
A formula of =NOW() is today's date. The formula changes the date every day.
1. MACRO.XLSM
2. GROUP.XLSM
coding on MACRO.XLSM to put todays date on cell A2 of GROUP.XLSM. Not put =NOW() on cell A2.
so when user open GROUP.XLMS next week, A2 will show dates of today.
yes I know.
I want to date the worksheet.
Right now, only thing I can think of is that =now() and save it as PDF, but I would really like to save it as XLSM.
I also save it's name to Group 1003.XLSM by using& Format(Date, "mmdd")
Something like this?
x = "=now()" Range("A2").Value = x
Workbooks("Group 1003.XLSM").Sheets("Sheet2").Range("A2").Value = Date
Either of these works
instead ofRange("A2").Value = Date Range("A2").Value = Now
I was usingRange("A2").Value = Now
Range("A2").Select.Value = Now
ok, that worked. So use Date instead of Now.
Now, if I open the workbook tomorrow, A2 should be dated today 10/3 not 10/4 correct?
Correct. You could use Date for the date only or Now for the current date and time.
Simply try..
Formula:[A2]=Now
OR
[A2]=Date
Regards,
Vikas Gautam
Excel-buzz.blogspot.com
Excel is not a matter of Experience, its a matter of Application.
Say Thanks, Click * Add Reputation
Thank you, that's ok it's working now.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks