Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help reducing lines of code
Hi
Using Windows Xp & XL2002 I require advice cleaning up part of my code printed below. I should add, the code is working ok. The code converts a single column of text 7 or 8 pages long to 3 to 4 pages of double columns of text. ( for printing only ). The two columns of text always fit across the page width .. The code cuts & copies the text from page 2 Column A & to Column C on page 1. The space left on page 2 Column A is deleted moving page 3 text up, to become the start of page 2. The code starts it's cut & paste again until 4 pages remain. Range("A60:A117").Cut Range("C2").Select ActiveSheet.Paste Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut Range("C60").Select ActiveSheet.Paste Range("A118:A175").Delete shift:=xlUp I would like to reduce the codes length, doing away with the Select part & combining some lines into one line.. Can the "Range("A60:A117").Cut" line be altered to include the "Delete shift=xlup". Can the Range("C2").Select line & the "ActiveSheet.Paste" line be combined. The code started out as a recorded macro, which I have modified to reduce the number of Activates & Selects but can not progress any further. The code does not start with any Dim statements or declarations etc. TIA Bob Christie (still on the steep learning curve) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help reducing lines of code
Range("A60:A117").Cut destination:=Range("C2")
Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut destination:=Range("C60") Range("A118:A175").Delete shift:=xlUp "Robert Christie" wrote in message ... Hi Using Windows Xp & XL2002 I require advice cleaning up part of my code printed below. I should add, the code is working ok. The code converts a single column of text 7 or 8 pages long to 3 to 4 pages of double columns of text. ( for printing only ). The two columns of text always fit across the page width . The code cuts & copies the text from page 2 Column A & to Column C on page 1. The space left on page 2 Column A is deleted moving page 3 text up, to become the start of page 2. The code starts it's cut & paste again until 4 pages remain. Range("A60:A117").Cut Range("C2").Select ActiveSheet.Paste Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut Range("C60").Select ActiveSheet.Paste Range("A118:A175").Delete shift:=xlUp I would like to reduce the codes length, doing away with the Select part & combining some lines into one line.. Can the "Range("A60:A117").Cut" line be altered to include the "Delete shift=xlup". Can the Range("C2").Select line & the "ActiveSheet.Paste" line be combined. The code started out as a recorded macro, which I have modified to reduce the number of Activates & Selects but can not progress any further. The code does not start with any Dim statements or declarations etc. TIA Bob Christie (still on the steep learning curve) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
help reducing lines of code
Hi Don
Thankyou very much for the quick reply. The destination:=Range is a new one to me. It worked like a charm. Thankyou again Bob Christie -----Original Message----- Range("A60:A117").Cut destination:=Range("C2") Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut destination:=Range("C60") Range("A118:A175").Delete shift:=xlUp "Robert Christie" wrote in message ... Hi Using Windows Xp & XL2002 I require advice cleaning up part of my code printed below. I should add, the code is working ok. The code converts a single column of text 7 or 8 pages long to 3 to 4 pages of double columns of text. ( for printing only ). The two columns of text always fit across the page width . The code cuts & copies the text from page 2 Column A & to Column C on page 1. The space left on page 2 Column A is deleted moving page 3 text up, to become the start of page 2. The code starts it's cut & paste again until 4 pages remain. Range("A60:A117").Cut Range("C2").Select ActiveSheet.Paste Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut Range("C60").Select ActiveSheet.Paste Range("A118:A175").Delete shift:=xlUp I would like to reduce the codes length, doing away with the Select part & combining some lines into one line.. Can the "Range("A60:A117").Cut" line be altered to include the "Delete shift=xlup". Can the Range("C2").Select line & the "ActiveSheet.Paste" line be combined. The code started out as a recorded macro, which I have modified to reduce the number of Activates & Selects but can not progress any further. The code does not start with any Dim statements or declarations etc. TIA Bob Christie (still on the steep learning curve) . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
help reducing lines of code
glad to help.
"Robert Christie" wrote in message ... Hi Don Thankyou very much for the quick reply. The destination:=Range is a new one to me. It worked like a charm. Thankyou again Bob Christie -----Original Message----- Range("A60:A117").Cut destination:=Range("C2") Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut destination:=Range("C60") Range("A118:A175").Delete shift:=xlUp "Robert Christie" wrote in message ... Hi Using Windows Xp & XL2002 I require advice cleaning up part of my code printed below. I should add, the code is working ok. The code converts a single column of text 7 or 8 pages long to 3 to 4 pages of double columns of text. ( for printing only ). The two columns of text always fit across the page width . The code cuts & copies the text from page 2 Column A & to Column C on page 1. The space left on page 2 Column A is deleted moving page 3 text up, to become the start of page 2. The code starts it's cut & paste again until 4 pages remain. Range("A60:A117").Cut Range("C2").Select ActiveSheet.Paste Range("A60:A117").Delete shift:=xlUp Range("A118:A175").Cut Range("C60").Select ActiveSheet.Paste Range("A118:A175").Delete shift:=xlUp I would like to reduce the codes length, doing away with the Select part & combining some lines into one line.. Can the "Range("A60:A117").Cut" line be altered to include the "Delete shift=xlup". Can the Range("C2").Select line & the "ActiveSheet.Paste" line be combined. The code started out as a recorded macro, which I have modified to reduce the number of Activates & Selects but can not progress any further. The code does not start with any Dim statements or declarations etc. TIA Bob Christie (still on the steep learning curve) . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code to fill in missing border lines | Excel Discussion (Misc queries) | |||
how do i comment 1000 lines of code at once in vba for excel? | Excel Worksheet Functions | |||
Code for Inserting Multiple lines | Excel Discussion (Misc queries) | |||
Excel skip some lines of VBA code | Excel Programming | |||
Code Text Into Chart Lines? | Excel Programming |