ILoveCheese
New Member
- Joined
- Mar 27, 2008
- Messages
- 27
The code I put together is suppose to:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
1. Cycle through a list of names (AH360:AH366) and apply them to the same set of formulas.<o></o>
2. All of formulas key off of a single cell (W385), this is where the names cycle to.<o></o>
3. The formulas generate totals based on the name. <o></o>
IE: Joe = 40 widgets (W2001:AD2001)<o></o>
4. The totals are then pulled and transfered to a "Totals" sheet and placed next to the appropriate person. (B6:B12)<o></o>
<o></o>
My code is doing all of this except that it is pasting the same data on the "Totals" sheet for every person.<o></o>
<o></o>
Sub LOOPTEST()<o></o>
Dim M As Integer, X As Integer
For M = 360 To 366
For X = 6 To 12<o></o>
Sheets("Plan Designs").Range("AH" & M).Copy Destination:=Range("W385")
Sheets("Plan Designs").Range("W2001:AD2001").Copy
Sheets("Totals").Range("B" & X).PasteSpecial xlValues<o></o>
Next X
Next M<o></o>
End Sub<o></o>
<o></o>
I got this to work with a simple version on the same sheet, but once I tried to cross over sheets I ran into this problem. I am stuck on trying to get each set of total data to copy and paste over before the next name generates a new set of data.<o></o>
1. Cycle through a list of names (AH360:AH366) and apply them to the same set of formulas.<o></o>
2. All of formulas key off of a single cell (W385), this is where the names cycle to.<o></o>
3. The formulas generate totals based on the name. <o></o>
IE: Joe = 40 widgets (W2001:AD2001)<o></o>
4. The totals are then pulled and transfered to a "Totals" sheet and placed next to the appropriate person. (B6:B12)<o></o>
<o></o>
My code is doing all of this except that it is pasting the same data on the "Totals" sheet for every person.<o></o>
<o></o>
Sub LOOPTEST()<o></o>
Dim M As Integer, X As Integer
For M = 360 To 366
For X = 6 To 12<o></o>
Sheets("Plan Designs").Range("AH" & M).Copy Destination:=Range("W385")
Sheets("Plan Designs").Range("W2001:AD2001").Copy
Sheets("Totals").Range("B" & X).PasteSpecial xlValues<o></o>
Next X
Next M<o></o>
End Sub<o></o>
<o></o>
I got this to work with a simple version on the same sheet, but once I tried to cross over sheets I ran into this problem. I am stuck on trying to get each set of total data to copy and paste over before the next name generates a new set of data.<o></o>