Please can I have a line of code that does the following: write current date and time to…
Jump to turn (7)
- 1Please can I have a line of code that does the following: write current date and
- 2I had an error on this line: .Range("L41").Value = Now
- 3Tied this but got the error: ThisWorkbook.Sheets("Start Page").Range("P41").Valu
- 4Instaed of using Now, can I use Date
- 5Error: Application defined or Object defined error on the line: ThisWorkbook.She
- 6I am still getting the error. This is how and where I am using it: Private Sub W
- 7When I comment out 'Range("P41").Value = Now, I do not get any errors
- User
Please can I have a line of code that does the following: write current date and time to worksheet 'Start Page' L41 and the text "opened" to M41.
- Assistant
You can use the following line of VBA code to write the current date and time to cell
L41on the worksheet named "Start Page", and the text "opened" to cellM41:vbaWith ThisWorkbook.Sheets("Start Page") .Range("L41").Value = Now .Range("M41").Value = "opened" End WithYou can add this code to a VBA module in Excel. To do this, press
ALT + F11to open the VBA editor, insert a new module from the Insert menu, and paste this code into the module. You can then run this code, and it will update the specified cells as required. - User