Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Copying to another worksheet

How can I copy columns from one worksheet to another in VBA? Also is there a
way to clear the whole sheet when I'm finished?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Copying to another worksheet

I'm using the below to sort my worksheet but can only sort by three columns,
does anyone know if it's possible to sort more then three columns? I haven't
been able to figure it out yet.




Range("A" & Last_Header_Row & ":AA55550").Sort
Key1:=Range(First_Column & Last_Header_Row), _
Order1:=xlAscending, Key2:=Range(Second_Column & Last_Header_Row), _
Order2:=xlAscending, Key3:=Range(Third_Column & Last_Header_Row), _
Order3:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying to another worksheet

worksheets(1).Columns(3).copy Destination:=Worksheets("Data").Range("F1")

Worksheets("Data").Cells.ClearContents
or
Worksheets("Data").Rows.Delete

--
Regards,
Tom Ogilvy

"HotRod" wrote in message
...
How can I copy columns from one worksheet to another in VBA? Also is there

a
way to clear the whole sheet when I'm finished?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying to another worksheet

Excel only allows you to sort on three columns at a time. However, it uses
a persistent sort, so you can sort repeatedly from your least significant
columns to the most significant columns (3 or less at a time) and the
results will be the same as if you sorted on all those columns at once.

--
Regards,
Tom Ogilvy

"HotRod" wrote in message
...
I'm using the below to sort my worksheet but can only sort by three

columns,
does anyone know if it's possible to sort more then three columns? I

haven't
been able to figure it out yet.




Range("A" & Last_Header_Row & ":AA55550").Sort
Key1:=Range(First_Column & Last_Header_Row), _
Order1:=xlAscending, Key2:=Range(Second_Column & Last_Header_Row),

_
Order2:=xlAscending, Key3:=Range(Third_Column & Last_Header_Row),

_
Order3:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Copying to another worksheet

THANKS



"Tom Ogilvy" wrote in message
...
worksheets(1).Columns(3).copy Destination:=Worksheets("Data").Range("F1")

Worksheets("Data").Cells.ClearContents
or
Worksheets("Data").Rows.Delete

--
Regards,
Tom Ogilvy

"HotRod" wrote in message
...
How can I copy columns from one worksheet to another in VBA? Also is
there

a
way to clear the whole sheet when I'm finished?






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
Worksheet formula incorrect after copying to another worksheet Karen Excel Worksheet Functions 2 November 12th 09 01:06 AM
Copying the active worksheet to another worksheet in the same work queenmaam Excel Worksheet Functions 5 March 25th 08 06:56 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Excel Discussion (Misc queries) 2 December 10th 06 06:02 AM
Copying a worksheet witrh protected cells to a new worksheet John Excel Worksheet Functions 2 February 1st 06 02:19 PM
Copying Worksheet triggers Click event of combobox on another worksheet Robert[_20_] Excel Programming 0 January 23rd 04 07:40 PM


All times are GMT +1. The time now is 08:39 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"