PC Review


Reply
Thread Tools Rate Thread

Copy and transpose paste from one worksheet to another

 
 
=?Utf-8?B?Sm9oblA=?=
Guest
Posts: n/a
 
      7th Jun 2007
Hi,

I need a macro that will copy a set of vertical data e.g. range A7:A25 from
a sheet called "PASTE TX HERE" and transpose paste it in the next free row
down (starting with row 2 on a sheet called "Leaver Master".

I need this to run at the end of a macro I have already written so please
give me some advice on where variable declaration should go or if there is a
code that I can put at the end of my macro to initiate the macro I hope you
can provide.

Thanks in advance.

JohnP
 
Reply With Quote
 
 
 
 
=?Utf-8?B?cXVhbGl0eXhwZXJ0?=
Guest
Posts: n/a
 
      8th Jun 2007
How about this, you could hide column A on the second sheet.
What this does is inserts a new row 1 on the second sheet, copies the data
in column A on the first sheet and pastes it in the new row 1, starting in
column B.
It also adds 1 to the maximum value in colum A and pastes this value in cell
A1. It then sorts all of the data on the second sheet by column A.

Sheets("Sheet2").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
ActiveCell.FormulaR1C1 = "=MAX(R[1]C:R[47]C)+1"
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("A2:A26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("B1").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Cells.Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D14").Select
--
Alan Jung
Triumph Structures
Chatsworth, CA 91311


"JohnP" wrote:

> Hi,
>
> I need a macro that will copy a set of vertical data e.g. range A7:A25 from
> a sheet called "PASTE TX HERE" and transpose paste it in the next free row
> down (starting with row 2 on a sheet called "Leaver Master".
>
> I need this to run at the end of a macro I have already written so please
> give me some advice on where variable declaration should go or if there is a
> code that I can put at the end of my macro to initiate the macro I hope you
> can provide.
>
> Thanks in advance.
>
> JohnP

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy transpose and paste error!? Darius Microsoft Excel Worksheet Functions 5 1st Aug 2009 04:23 PM
Copy and Transpose Paste HAS Microsoft Excel Misc 1 15th Feb 2009 01:50 PM
Copy then Paste with a transpose SteveM Microsoft Excel Misc 2 29th Nov 2007 06:01 PM
Copy and transpose paste across several worksheets =?Utf-8?B?Sm9oblA=?= Microsoft Excel Programming 2 6th Jun 2007 02:37 PM
Copy and transpose paste =?Utf-8?B?Sm9oblA=?= Microsoft Excel Programming 0 5th Jun 2007 10:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 AM.