#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I copy a data from a single column into an array and back into another column? [email protected] Excel Programming 1 February 10th 07 05:03 AM
Find specific column titles and copy the column to new workboo JLGWhiz Excel Programming 0 December 11th 06 11:23 PM
Find specific column titles and copy the column to new workboo JLGWhiz Excel Programming 0 December 11th 06 11:09 PM
Save column J only using copy/paste & temporary copy mikeburg[_85_] Excel Programming 2 June 7th 06 05:37 PM
To copy values in a column relevant to text in an adjacent column? Guy Keon Excel Worksheet Functions 2 November 15th 05 08:10 PM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"