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: 141
Default Pasting Q

I received the following code from Tom Olgivy which extracts values in
worksheet Recipes A9;B9;J28;K28;L28;N28 and O28 and pastes these values in
worksheet Master Costs starting at A1:G1 and works down depending on the
last value in Recipes A:

I want now to continue 'pasting' in Master Costs, but this time the 'source
data' comes from a worksheet called 'Meals'. My 'Meals' worksheet has the
same layout that is in the Recipe worksheet except I want to start pasting
these values from Meals worksheet whever the pasting stops in the code
below. The ending row obviously changes depending on the data in Recipes. -
I'm lost as to where I should place this code within the code below

Thanks



Sub Master_Cost_Post()
Dim i As Long, j As Long, k As Long, l As Long
Dim rng As Range, cell As Range
With Worksheets("Recipes")
Set rng = Union(.Range("A9"), .Range("B9"), .Range("J28"), .Range("K28"),
..Range("L28"), .Range("N28"), .Range("O28"))

i = 0
j = 0
l = 0
For Each cell In rng
j = cell.Row
k = 1
l = l + 1
Do While Not IsEmpty(.Cells(j, cell.Column))
.Cells(j, cell.Column).Copy
Worksheets("Master Costs") _
.Cells(k, l).PasteSpecial xlValues
k = k + 1
j = j + 22
Loop
Next
End With


 
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
pasting David Gerstman Excel Worksheet Functions 2 July 13th 07 08:02 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Pasting Into new sheet Todd Nelson Excel Discussion (Misc queries) 0 August 6th 05 01:17 AM
Pasting Links shertay Excel Discussion (Misc queries) 1 July 16th 05 08:14 PM
Pasting numbers and formulas without pasting format. Dan Excel Discussion (Misc queries) 3 March 27th 05 03:47 AM


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