Paste without formatting

I have a macro which pastes text from clipboard (the text is formatted) to excel:

How to paste this text without formatting?
If i replace Paste Action with Keystroke Action - shift+cmd+v - it doesn't work by some reason.

Add this action before "Paste" and you should be good:

Then it just skips the required and formatted text from clipboard and pastes the one that comes after it.

Please try uploading the whole macro so we can see how it’s supposed to work in its entirety; that should make it easier for us to figure out what’s wrong.

It sounds like your macro is getting confused as to which clipboard entry it is referring to.

Assuming you are uninterested in formatting, and there are multiple entries on the clipboard history you wish to process, I suggest you design your macro something like this:

  • Set variable “First” to “%PastClipboard%0%”
  • Set variable “Second” to “%PastClipboard%1%”
  • Set variable “Third” to “%PastClipboard%2%”
  • Insert Text by Pasting “%Variable%Second%”
  • etc

That is, read the clipboard history you are interested in to variables (which have no styling) and then paste them from variables as necessary (avoiding confusion when the clipboard history changes as you paste different things in).

If this is not what you are trying to do, then probably it would make things easier on all of us if:

  • You explain what you are actually trying to do
  • Post the full macro

“full macro” really means, a complete macro that includes the minimum amount of steps to demonstrate the problem. So if you have a very complex macro with lots of extraneous steps, and some part of it is not working as you’d like, make a new macro with just that part, confirm that it does not behave as you want it to, and post that.

Often knowing what you are actually trying to do well help us give you a better answer since there may be entirely different ways to solve the problem that are easier or more effective.

2 Likes

I have had very weird experiences with clipboard from Excel.
It seems it does not always write to the clipboard instantly. So you copy something.
Use KM to do something with the clipboard.
And expect a certain result.
But suddenly Excel places the original in the clipboard again.

I have had some luck pressing escape after copying in Excel.

It seems this removes Excels desire to keep changing the clipboard.

I think Excel may not put public types on the Clipboard until it receives notice that it is losing focus. So, one possible solution/workaround is to switch to (activate) another app after a copy of excel cell(s). You can also use the CLIPBOARDSEED() function to determine if the Clipboard has changed.

1 Like

You could put into words what my experience has been. Thanks.