简体   繁体   中英

Paste values disabled in Excel when recording a macro

I started to record a macro, added a name and inserted the formula =NOW( ) in a cell.

After selecting and copying this cell, I want to convert the formula to its value by "Paste Values" in Home->Clipboard->Paste menu.

The Paste Values submenu command is disabled, and the Record Macro button is disabled. This results in being unable to stop recording the macro.

How can this be solved?

I wasn't able to replicate this behaviour so not sure why you are unable to stop recording your macro but...

I presume you are trying to have the cell contents contain the time / date at a fixed point and not change every time you open the spreadsheet or recalculate? If so, a line such as:

activesheet.range("A1").value = now()

This removes the need to faff about with copying and pasting values.

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM