LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copying and Pasting Different Formulas

Greetings!

I have a workbook several sheets, say Sheet 1-10. The first sheet, say
Sheet1, contains 4 different formulas that I need to paste into the other
sheets. The formulas are contained in cells A1:D1 so that each cell contains
a different formula. The issue is that I dont need all the formulas in all
sheets. For some of the sheets I only need one of the formulas, for some I
need two of them, and for others I need three of them. Therefore, I cant just
copy cells A1:D1 as a group and paste into the other sheets.

I'm trying to have my macro store all the different formulas, so that when
each of the sheets 2-10 is activated I can paste formulas that apply to that
sheet. The code that I came up with is (to make it shorter, I only show the
part that applies to sheet2):

dim rng1 as range, rng2 as range, rng3 as range, rng4 as range
dim rng5 as range, rng6 as range
set rng1 = Worksheets("Sheet1").Range("A1")
set rng2 = Worksheets("Sheet1").Range("B1")
set rng3 = Worksheets("Sheet1").Range("C1")
set rng4 = Worksheets("Sheet1").Range("D1")
fm1 = rng1.formulas
fm2 = rng2.formulas
fm3 = rng3.formulas
fm4 = rng4.formulas

Set rng5 = Worksheets("Sheet2").Range("E1")
Set rng6 = Worksheets("Sheet2").Range("F1").
rng5=fm1
rng6=fm3

The problem with this is that the formulas are absolute. The macro uses the
same exact formulas contained in cells A1:D1, without adjusting to the
position of the destination cells (Sheet2!E1:F1 in this case). Is it possible
to have it the macro adjust for the position of the destination cells?

I would greatly appreciate any insight that you provide on this!

Sincerely,

Magnivy



 
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
TROUBLE COPYING AND PASTING FORMULAS belga Excel Worksheet Functions 2 July 3rd 06 04:03 AM
Copying/Pasting Formulas SamGB Excel Discussion (Misc queries) 4 February 24th 06 11:22 PM
Copying and pasting multiple formulas, it it possible? Tim Excel Discussion (Misc queries) 2 November 24th 05 09:33 AM
Copying & pasting formulas Shawn Excel Worksheet Functions 2 October 28th 05 09:52 PM
Pasting formulas without copying file ref. John Tolman[_2_] Excel Programming 1 July 15th 04 02:31 AM


All times are GMT +1. The time now is 07:29 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"