![]() |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 01:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com