Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
I have code that sorts data worksheet sub (AAAA)
Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
Curt,
As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
As all ways one does not fully explain the problem. I am trying to do this in
vba code as a sub procedure. Not sure of codeing The procedure will be acessed from an user form. You will not be on the active sheet. If I follow data worksheet must be activated first and the run sub AAAA then ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") ActiveSheet.Range("D:D").Copy Sheets("Sheet2").Range("D:D") ActiveSheet.Range("E:E").Copy Sheets("Sheet2").Range("E:E") ActiveSheet.Range("G:G").Copy Sheets("Sheet2").Range("G:G") ActiveSheet.Range("L:L").Copy Sheets("Sheet2").Range("L:L") correct Thanks "Vergel Adriano" wrote: Curt, As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
Hi Curt,
I only used ActiveSheet as an example because I assumed you wanted to work with the activesheet. But, you don't really have to activate your sheet. For example, this will also work: 'Copy column A from sheet named "Sheet1" to a sheet named "Sheet2" Sheets("Sheet1").Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: As all ways one does not fully explain the problem. I am trying to do this in vba code as a sub procedure. Not sure of codeing The procedure will be acessed from an user form. You will not be on the active sheet. If I follow data worksheet must be activated first and the run sub AAAA then ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") ActiveSheet.Range("D:D").Copy Sheets("Sheet2").Range("D:D") ActiveSheet.Range("E:E").Copy Sheets("Sheet2").Range("E:E") ActiveSheet.Range("G:G").Copy Sheets("Sheet2").Range("G:G") ActiveSheet.Range("L:L").Copy Sheets("Sheet2").Range("L:L") correct Thanks "Vergel Adriano" wrote: Curt, As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
call AAAA
worksheet("Data").range.(A:A).copy worksheet(announcer")range("A:A").paste worksheet("Data").range.("D:D").copy worksheet(announcer")range("D:D").paste and so on right Thanks "Vergel Adriano" wrote: Hi Curt, I only used ActiveSheet as an example because I assumed you wanted to work with the activesheet. But, you don't really have to activate your sheet. For example, this will also work: 'Copy column A from sheet named "Sheet1" to a sheet named "Sheet2" Sheets("Sheet1").Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: As all ways one does not fully explain the problem. I am trying to do this in vba code as a sub procedure. Not sure of codeing The procedure will be acessed from an user form. You will not be on the active sheet. If I follow data worksheet must be activated first and the run sub AAAA then ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") ActiveSheet.Range("D:D").Copy Sheets("Sheet2").Range("D:D") ActiveSheet.Range("E:E").Copy Sheets("Sheet2").Range("E:E") ActiveSheet.Range("G:G").Copy Sheets("Sheet2").Range("G:G") ActiveSheet.Range("L:L").Copy Sheets("Sheet2").Range("L:L") correct Thanks "Vergel Adriano" wrote: Curt, As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
Close... There is no "worksheet" collection. You use either Sheets() or
Worksheets() and there's some missing dots on your code.. You can also make your code shorter by passing the destination to the copy method so you don't have to call Paste. So: call AAAA Worksheets("Data").Range("A:A").Copy Worksheets("announcer").Range("A:A") Worksheets("Data").Range("D:D").Copy Worksheets("announcer").Range("D:D") '... and so on... -- Hope that helps. Vergel Adriano "Curt" wrote: call AAAA worksheet("Data").range.(A:A).copy worksheet(announcer")range("A:A").paste worksheet("Data").range.("D:D").copy worksheet(announcer")range("D:D").paste and so on right Thanks "Vergel Adriano" wrote: Hi Curt, I only used ActiveSheet as an example because I assumed you wanted to work with the activesheet. But, you don't really have to activate your sheet. For example, this will also work: 'Copy column A from sheet named "Sheet1" to a sheet named "Sheet2" Sheets("Sheet1").Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: As all ways one does not fully explain the problem. I am trying to do this in vba code as a sub procedure. Not sure of codeing The procedure will be acessed from an user form. You will not be on the active sheet. If I follow data worksheet must be activated first and the run sub AAAA then ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") ActiveSheet.Range("D:D").Copy Sheets("Sheet2").Range("D:D") ActiveSheet.Range("E:E").Copy Sheets("Sheet2").Range("E:E") ActiveSheet.Range("G:G").Copy Sheets("Sheet2").Range("G:G") ActiveSheet.Range("L:L").Copy Sheets("Sheet2").Range("L:L") correct Thanks "Vergel Adriano" wrote: Curt, As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
column copy
Thank you so much you are a great help
Thanks again "Vergel Adriano" wrote: Close... There is no "worksheet" collection. You use either Sheets() or Worksheets() and there's some missing dots on your code.. You can also make your code shorter by passing the destination to the copy method so you don't have to call Paste. So: call AAAA Worksheets("Data").Range("A:A").Copy Worksheets("announcer").Range("A:A") Worksheets("Data").Range("D:D").Copy Worksheets("announcer").Range("D:D") '... and so on... -- Hope that helps. Vergel Adriano "Curt" wrote: call AAAA worksheet("Data").range.(A:A).copy worksheet(announcer")range("A:A").paste worksheet("Data").range.("D:D").copy worksheet(announcer")range("D:D").paste and so on right Thanks "Vergel Adriano" wrote: Hi Curt, I only used ActiveSheet as an example because I assumed you wanted to work with the activesheet. But, you don't really have to activate your sheet. For example, this will also work: 'Copy column A from sheet named "Sheet1" to a sheet named "Sheet2" Sheets("Sheet1").Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: As all ways one does not fully explain the problem. I am trying to do this in vba code as a sub procedure. Not sure of codeing The procedure will be acessed from an user form. You will not be on the active sheet. If I follow data worksheet must be activated first and the run sub AAAA then ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") ActiveSheet.Range("D:D").Copy Sheets("Sheet2").Range("D:D") ActiveSheet.Range("E:E").Copy Sheets("Sheet2").Range("E:E") ActiveSheet.Range("G:G").Copy Sheets("Sheet2").Range("G:G") ActiveSheet.Range("L:L").Copy Sheets("Sheet2").Range("L:L") correct Thanks "Vergel Adriano" wrote: Curt, As an example, to copy column A in the activesheet to column A of a sheet named Sheet2: ActiveSheet.Range("A:A").Copy Sheets("Sheet2").Range("A:A") -- Hope that helps. Vergel Adriano "Curt" wrote: I have code that sorts data worksheet sub (AAAA) Need code in another procedure that will run sort code first (AAAA) Then copy columns (A),(D),(E),(G),(L) to worksheet announcer. This builds the worksheet to be used with a mail merge for printing announcer cards. Have not tried to copy columns only cells Help Greatly Appreciated Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I copy a data from a single column into an array and back into another column? | Excel Programming | |||
Find specific column titles and copy the column to new workboo | Excel Programming | |||
Find specific column titles and copy the column to new workboo | Excel Programming | |||
Save column J only using copy/paste & temporary copy | Excel Programming | |||
To copy values in a column relevant to text in an adjacent column? | Excel Worksheet Functions |