Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create an undoable 'paste formula' macro

Hello,
I use the 'Paste Special Formula' functionality very often
and therefore would like to set up a shortcut key. I have
recorded a macro but the BIG issue is that then, I am not
able to undo if I pasted in the wrong place.
I did found a few exemples of 'Undo' VBA macros on the NEt
but none would work with 'Paste Special' as the content of
the clipboard gets cleared when I launch them (and
therefore there is nothing to copy anymore!)
Would anyone be kind enough to provide me with the
complete code for those two macros (Paste Formula and Undo
paste formula)?

Many thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Create an undoable 'paste formula' macro

Hi Luc,

I use the 'Paste Special Formula' functionality very often
and therefore would like to set up a shortcut key. I have
recorded a macro but the BIG issue is that then, I am not
able to undo if I pasted in the wrong place.
I did found a few exemples of 'Undo' VBA macros on the NEt
but none would work with 'Paste Special' as the content of
the clipboard gets cleared when I launch them (and
therefore there is nothing to copy anymore!)
Would anyone be kind enough to provide me with the
complete code for those two macros (Paste Formula and Undo
paste formula)?


This clumsy code does the paste formula thing without you loosing your
undo:

Sub PasteFormula()
SendKeys "%es{down}~"
End Sub

You must attach the macro to a toolbar button for it to work though and
it only works on an English Excel.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create an undoable 'paste formula' macro

VERY clever indeed! Thanks a lot.
-----Original Message-----
Hi Luc,

I use the 'Paste Special Formula' functionality very

often
and therefore would like to set up a shortcut key. I

have
recorded a macro but the BIG issue is that then, I am

not
able to undo if I pasted in the wrong place.
I did found a few exemples of 'Undo' VBA macros on the

NEt
but none would work with 'Paste Special' as the content

of
the clipboard gets cleared when I launch them (and
therefore there is nothing to copy anymore!)
Would anyone be kind enough to provide me with the
complete code for those two macros (Paste Formula and

Undo
paste formula)?


This clumsy code does the paste formula thing without you

loosing your
undo:

Sub PasteFormula()
SendKeys "%es{down}~"
End Sub

You must attach the macro to a toolbar button for it to

work though and
it only works on an English Excel.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
1 Create a macro to Copy & paste certain data to another sheet Lin1981 Excel Discussion (Misc queries) 1 November 6th 08 11:56 PM
how to create a copy/paste special/transpose macro? [email protected] Excel Discussion (Misc queries) 6 August 8th 07 06:07 AM
How to create a macro which performs a copy-and-paste task every 5mins after data is refreshed from web page? ­»´ä®a©~¸Ë­× Excel Worksheet Functions 0 December 5th 06 08:57 AM
How do I copy and paste a formula I create to subtotals only? octoberskyy Excel Worksheet Functions 0 July 19th 06 02:39 PM
I need formula help or create a macro to copy and paste value only Rebecca Excel Discussion (Misc queries) 4 April 8th 06 01:18 PM


All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"