hi,
i cant seem to get this one right....
what im trying to do is fill column S-T-U with a list in column A.
i need the bottom 80 from the list to go to column U, then the next 80 before that to go to column T, then the remainder go to column S.
this is what i have so far, now it copys to column S fine with the correct amount it needs to but iv run into a problem trying to set the range of the next 80
im not too sure what im doing wrong.
i cant seem to get this one right....
what im trying to do is fill column S-T-U with a list in column A.
i need the bottom 80 from the list to go to column U, then the next 80 before that to go to column T, then the remainder go to column S.
this is what i have so far, now it copys to column S fine with the correct amount it needs to but iv run into a problem trying to set the range of the next 80
Code:
'count list in column A
Dim myRng As Range
Dim nResult As Long
Dim LASTR As Long
LASTR = Range("A65536").End(xlUp).Row
Set myRng = Range("A2:A" & LASTR)
nResult = WorksheetFunction.CountA(myRng)
'set range of col-1 and copy
Dim oneLR As Variant
Dim oneGRange As Range
oneLR = (nResult - 159)
Set oneGRange = Range("A2:A" & oneLR)
oneGRange.Copy
Range("S1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'set range of col-2 and copy
Dim twoGRange As Range
Dim twoFR As Long
Dim twoLR As Long
twoFR = oneLR.Offset(1, 0)
twoLR = oneLR.Offset(81, 0)
Set twoGRange = Range(twoFR, twoLR)
twoGRange.Copy
Range("T1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'set range of col-3 and copy
Dim threeGRange As Range
Dim threeFR As Long
Dim threeLR As Long
threeFR = twoLR.Offset(1, 0)
threeLR = twoLR.Offset(81, 0)
Set threeGRange = Range(threeFR, threeLR)
threeGRange.Copy
Range("U1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False