A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro to COPY FORMULA BETWEEN RANGES



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2010, 01:43 PM posted to microsoft.public.excel.misc
Randy
external usenet poster
 
Posts: 398
Default Macro to COPY FORMULA BETWEEN RANGES

I have a vlookup under inventory, orders & POs, I need to copy and paste it
to the end of that range, then go to the next section and paste. This need to
continue through many different ranges, and the number of rows could change.
Any ideas.

I did name the ranges ie "tissue", and "paper towels", maybe there is a way
to copy formula from 1st row throughout all range names, but that still
leaves the remaining rows in the first range.

Any help would be appreciated

Paper Products - WASHROOM TISSUE
Proteus Open Open
Description Inventory Orders P.O.s
11375 RESPONSE 241 1154 1100
11440 RESPONSE
14800 ECO SOFT


Paper Products - PAPER TOWELS
Proteus Open Open
Description Inventory Orders P.O.s
RK600E ROLL - BROWN
SK1850A SINGLEFOLD-BROWN

--
Randy
  #2  
Old May 13th, 2010, 02:20 PM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 7,584
Default Macro to COPY FORMULA BETWEEN RANGES

This little macro takes the formula in the first cell in a pre-defined range
and copies it to the other cells in that range:

Sub CopyDemo()
Dim r1 As Range, r2 As Range
Set r2 = Range("SampleRange")
Set r1 = r2(1)
r1.Copy
r2.PasteSpecial Paste:=xlPasteFormulas
End Sub

You would need to loop over your other Named Ranges.
--
Gary''s Student - gsnu201003


"Randy" wrote:

I have a vlookup under inventory, orders & POs, I need to copy and paste it
to the end of that range, then go to the next section and paste. This need to
continue through many different ranges, and the number of rows could change.
Any ideas.

I did name the ranges ie "tissue", and "paper towels", maybe there is a way
to copy formula from 1st row throughout all range names, but that still
leaves the remaining rows in the first range.

Any help would be appreciated

Paper Products - WASHROOM TISSUE
Proteus Open Open
Description Inventory Orders P.O.s
11375 RESPONSE 241 1154 1100
11440 RESPONSE
14800 ECO SOFT


Paper Products - PAPER TOWELS
Proteus Open Open
Description Inventory Orders P.O.s
RK600E ROLL - BROWN
SK1850A SINGLEFOLD-BROWN

--
Randy

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:28 PM.


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