Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default copy formula

I want to create a macro that will copy a range of formulas and the paste
them into a new range keeping all cell references absolute. I can accomplish
this in vba using:

..Range("A11:D20").Formula = .Range("A1:D10").Formula

But then I need to have a screen to get the source and target ranges. Is
there a way to copy and then paste special (my vba special) absolute
references on paste command? Like Ctrl C to copy and then Ctrl Z to paste
the exact formulas instead of Ctrl V to paste relative formulas? I don't
want to add $ signs and sometimes it isn't practicle.

Thanks,
Dave


Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default copy formula

Hi Dave,

One way:

Select your cells with formulas to copy
Press Ctrl+H (or go to menu EditReplace) and replace "=" with "'="
Copy your cells in a normal way (Ctrl+C, Ctrl+V)
Select your new cells with formulas
Press Ctrl+H and replace "'=" with "="

Regards,
KL


"dave k" wrote in message
...
I want to create a macro that will copy a range of formulas and the paste
them into a new range keeping all cell references absolute. I can
accomplish
this in vba using:

.Range("A11:D20").Formula = .Range("A1:D10").Formula

But then I need to have a screen to get the source and target ranges. Is
there a way to copy and then paste special (my vba special) absolute
references on paste command? Like Ctrl C to copy and then Ctrl Z to paste
the exact formulas instead of Ctrl V to paste relative formulas? I don't
want to add $ signs and sometimes it isn't practicle.

Thanks,
Dave


Thanks for the help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default copy formula

Thanks. I have seen this example. I believe you meant to write "replace '='
with '#'". I would still like to have a vba function so that I can give this
to some coworkers who will forget the steps.
Thanks again.

"KL" wrote:

Hi Dave,

One way:

Select your cells with formulas to copy
Press Ctrl+H (or go to menu EditReplace) and replace "=" with "'="
Copy your cells in a normal way (Ctrl+C, Ctrl+V)
Select your new cells with formulas
Press Ctrl+H and replace "'=" with "="

Regards,
KL


"dave k" wrote in message
...
I want to create a macro that will copy a range of formulas and the paste
them into a new range keeping all cell references absolute. I can
accomplish
this in vba using:

.Range("A11:D20").Formula = .Range("A1:D10").Formula

But then I need to have a screen to get the source and target ranges. Is
there a way to copy and then paste special (my vba special) absolute
references on paste command? Like Ctrl C to copy and then Ctrl Z to paste
the exact formulas instead of Ctrl V to paste relative formulas? I don't
want to add $ signs and sometimes it isn't practicle.

Thanks,
Dave


Thanks for the help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default copy formula

Hi Dave,

Although, it doesn't make a lot of difference, I meant what I wrote "replace
"=" with "'=" (there is an apostrophe in the latter) which is the most
common way of converting values/formulas to text.

Regards,
KL


"dave k" wrote in message
...
Thanks. I have seen this example. I believe you meant to write "replace
'='
with '#'". I would still like to have a vba function so that I can give
this
to some coworkers who will forget the steps.
Thanks again.

"KL" wrote:

Hi Dave,

One way:

Select your cells with formulas to copy
Press Ctrl+H (or go to menu EditReplace) and replace "=" with "'="
Copy your cells in a normal way (Ctrl+C, Ctrl+V)
Select your new cells with formulas
Press Ctrl+H and replace "'=" with "="

Regards,
KL


"dave k" wrote in message
...
I want to create a macro that will copy a range of formulas and the
paste
them into a new range keeping all cell references absolute. I can
accomplish
this in vba using:

.Range("A11:D20").Formula = .Range("A1:D10").Formula

But then I need to have a screen to get the source and target ranges.
Is
there a way to copy and then paste special (my vba special) absolute
references on paste command? Like Ctrl C to copy and then Ctrl Z to
paste
the exact formulas instead of Ctrl V to paste relative formulas? I
don't
want to add $ signs and sometimes it isn't practicle.

Thanks,
Dave


Thanks for the help.






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
copy formula result (text) only - without copying formula Mulberry Excel Discussion (Misc queries) 2 October 2nd 08 09:51 AM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy formula so destination displays formula as text Omunene Excel Discussion (Misc queries) 2 September 30th 05 06:28 PM


All times are GMT +1. The time now is 04:14 AM.

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

About Us

"It's about Microsoft Excel"