Thread
:
A hard DO loop for me
View Single Post
#
3
Posted to microsoft.public.excel.programming
Tushar Mehta
external usenet poster
Posts: 1,071
A hard DO loop for me
*What* are you doing?
Each paste is partially overwriting the result of the previous paste
operations.
Also, for the first two you are copying B:K, but for the third the
range is A:K.
You might want to reexamine what exactly you want to do.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
says...
Fellow coders,
I have large files of data where I need to
copy every other row alongside the initial
row, and then delete the rows that are
copied.
An example of the procedure's code, without
ANY loops whatsoever follows:
Range("B3:K3").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
Range("B5:K5").Select
Application.CutCopyMode = False
Selection.Copy
Range("L4").Select
ActiveSheet.Paste
Range("A7:K7").Select
Application.CutCopyMode = False
Selection.Copy
Range("L6").Select
ActiveSheet.Paste
Range("3:3,5:5,7:7").Select
Range("A7").Activate
Selection.Delete Shift:=xlUp
I absolutely cannot do this without loops,
as the code will exceed the maximum allowable
lines.
How do I set the DO loop variables to do this
kind of incremental, every other row, rearrange,
and then delete?
Thanks,
Bert Gold
Reply With Quote
Tushar Mehta
View Public Profile
Find all posts by Tushar Mehta