I'm thinking now that I want to do something different. Instead of putting a button on the spreadsheet, I think it would be better to have a macro in the ribbon. I created a ribbon called time with a group called current time and inserted a command macro called time into it which has the script that you provided
When I put the cursor in the cell where I want the current time inserted and click on the time macro in the ribbon, I get an error:
Compile error:
Expected Function or variable
What am i doing wrong?
Bookmarks