Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Cordobes
 
Posts: n/a
Default Copy formulas via Code

I have a range with formulas on sheet2 called "database". I want to get this
range and transfer it's contents to sheet1 called "work", but I want the
formulas to update themselves to this new location, and not show the same
exact formula that was found in the original range. I had tried :

sheets("work").range("a1:b10").formula =
sheets("database").range("d1:e10").formula

with the following results

Cells d1 to d10 on sheet database contain X values, and cells e1 to e10
contain the formula =d1*d1, =d2*d2, and so forth.

What I obtain on cells a1 to b10 on sheet work is exactly the same formulase
outlined above ( ie : = d1*d2 ) instead of the formula getting updated to =
a1*a1, = a2*a2.

I don't want to use the copy paste method because it changes the sheet
selection and I have code written for the activate and deactivate events on
each of these sheets.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Copy formulas via Code

One way:

Sheets("work").Range("a1:b10").FormulaR1C1 _
= Sheets("database").Range("d1:e10").FormulaR1C1

Another way is to copy|paste special|formulas



Cordobes wrote:

I have a range with formulas on sheet2 called "database". I want to get this
range and transfer it's contents to sheet1 called "work", but I want the
formulas to update themselves to this new location, and not show the same
exact formula that was found in the original range. I had tried :

sheets("work").range("a1:b10").formula =
sheets("database").range("d1:e10").formula

with the following results

Cells d1 to d10 on sheet database contain X values, and cells e1 to e10
contain the formula =d1*d1, =d2*d2, and so forth.

What I obtain on cells a1 to b10 on sheet work is exactly the same formulase
outlined above ( ie : = d1*d2 ) instead of the formula getting updated to =
a1*a1, = a2*a2.

I don't want to use the copy paste method because it changes the sheet
selection and I have code written for the activate and deactivate events on
each of these sheets.

Any suggestions?


--

Dave Peterson
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
How do I copy & paste formulas without them linking to the source Ineluctable Excel Discussion (Misc queries) 8 December 11th 05 08:49 PM
Excel 2002; copy formulas to one workbook to another diff data SinnetBS Excel Worksheet Functions 1 November 25th 05 08:31 PM
Macro to copy range of formulas to equal data lines lh Excel Worksheet Functions 2 August 15th 05 04:37 PM
reminder notifications in a column L Mieth Excel Discussion (Misc queries) 6 June 10th 05 11:00 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 09:08 PM.

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"