Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO TO COPY TO A RANGE
I want a macro to copy A1:D1 up to the end of an empty cell, then do the same
procedure for row 4 and so on and will stop only if the last row of the data in Col D=xxx (I dont know how to stop a macro and to loop in Excel, w/c I can do in Lotus). This would be an easy one for Macro experts and would appreciate your help since I'm new to Excel Macros. colA colB colC colD colE 1 aa bb cc dd 2 3 4 aa2 bb2 cc2 dd2 5 6 7 8 aa3 bb3 cc3 dd3 9 10 aa4 bb4 cc4 dd4 xxx |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO TO COPY TO A RANGE
Not tested sub Printout_Ranges() dim i as integer i=0 Range("A1").select set a=selection do until i=4 a.offset(0,i).select a.end(xldown).select set z=selection if z.offset(0,i).value="" and a.offset(0,i).value="" then goto doop end if if z.offset(0,i).value="" then range(a.offset(0,i).printout=1 else range(a.offset(0,i).address, z.address).printout=1 end if Doop: i=i+1 loop end sub "asuncionw" wrote: I want a macro to copy A1:D1 up to the end of an empty cell, then do the same procedure for row 4 and so on and will stop only if the last row of the data in Col D=xxx (I dont know how to stop a macro and to loop in Excel, w/c I can do in Lotus). This would be an easy one for Macro experts and would appreciate your help since I'm new to Excel Macros. colA colB colC colD colE 1 aa bb cc dd 2 3 4 aa2 bb2 cc2 dd2 5 6 7 8 aa3 bb3 cc3 dd3 9 10 aa4 bb4 cc4 dd4 xxx |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO TO COPY TO A RANGE
Thanks, will try it and let you know.
"exceluserforeman" wrote: Not tested sub Printout_Ranges() dim i as integer i=0 Range("A1").select set a=selection do until i=4 a.offset(0,i).select a.end(xldown).select set z=selection if z.offset(0,i).value="" and a.offset(0,i).value="" then goto doop end if if z.offset(0,i).value="" then range(a.offset(0,i).printout=1 else range(a.offset(0,i).address, z.address).printout=1 end if Doop: i=i+1 loop end sub "asuncionw" wrote: I want a macro to copy A1:D1 up to the end of an empty cell, then do the same procedure for row 4 and so on and will stop only if the last row of the data in Col D=xxx (I dont know how to stop a macro and to loop in Excel, w/c I can do in Lotus). This would be an easy one for Macro experts and would appreciate your help since I'm new to Excel Macros. colA colB colC colD colE 1 aa bb cc dd 2 3 4 aa2 bb2 cc2 dd2 5 6 7 8 aa3 bb3 cc3 dd3 9 10 aa4 bb4 cc4 dd4 xxx |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
MACRO TO COPY TO A RANGE
Im getting syntax error on this line:
range(a.offset(0,i).printout=1 "exceluserforeman" wrote: Not tested sub Printout_Ranges() dim i as integer i=0 Range("A1").select set a=selection do until i=4 a.offset(0,i).select a.end(xldown).select set z=selection if z.offset(0,i).value="" and a.offset(0,i).value="" then goto doop end if if z.offset(0,i).value="" then range(a.offset(0,i).printout=1 else range(a.offset(0,i).address, z.address).printout=1 end if Doop: i=i+1 loop end sub "asuncionw" wrote: I want a macro to copy A1:D1 up to the end of an empty cell, then do the same procedure for row 4 and so on and will stop only if the last row of the data in Col D=xxx (I dont know how to stop a macro and to loop in Excel, w/c I can do in Lotus). This would be an easy one for Macro experts and would appreciate your help since I'm new to Excel Macros. colA colB colC colD colE 1 aa bb cc dd 2 3 4 aa2 bb2 cc2 dd2 5 6 7 8 aa3 bb3 cc3 dd3 9 10 aa4 bb4 cc4 dd4 xxx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to find, copy, and paste until value change | Excel Worksheet Functions | |||
Macro to open workbook and copy and paste values in to orig workbo | Excel Worksheet Functions | |||
Resize Range - Macro | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Macro to copy cells | Excel Discussion (Misc queries) |