column copy

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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")
 
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
 
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")
 
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
 
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top