Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a Macro to Copy and move data! - HELP!
Hello,
This is my first time doing this, so please forgive my lack of knowledge. I am trying to copy information from a sheet in excel to another, so I did a record macro and performed the operations....problem is, I need this repeated until all the data is done. Present Layout: Column A ColumnB ColumnC, etc SalesOrder 1234 5678 PONumber 6678 1111 InvoiceDate 12/22/07 12/22/47 RequiredSipDate 08/12/07 01/01/2008 And I'd like it to look like this SalesOrder PONumber InvoiceDate RequiredSipDate 1234 6678 12/22/07 08/12/07 5678 1111 12/22/47 01/01/07 and I'd like the Macro/Program to run until there is no more info in the sales order row of the original layout. Help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a Macro to Copy and move data! - HELP!
Try this one-step approach - Using Paste-Transpose
Give your Sales Info in the Original Data sheets a range name of "SalesInfo". I've used "Original Data" and "New Data" as sheet names ... you'll need to change these to your sheet names. Then: Sub Switcharoo() WorkSheets("Original Data").Range("SalesInfo").Copy Worksheets("New Data").Range("A1").PasteSpecial Paste:=xlPasteAll, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=True End sub Hope this helps Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a Macro to Copy and move data! - HELP!
Hi Hopeless inChicago
Here's one possible way. This macro assumes 4 headers as shown in your example. Change the worksheet names to match your sheets. regards, Dave Sub Arrnge() Dim rng1 As Range, x As Integer, cnt As Integer Dim wk1 As Worksheet, wk2 As Worksheet Set wk1 = Worksheets("sourcesheet") Set wk2 = Worksheets("targetsheet") wk1.Activate Set rng1 = Intersect(Rows(2), ActiveSheet.UsedRange) x = rng1.Count cnt = 1 With wk2 Do While rng1(cnt) < "" For x = 1 To 4 .Cells(cnt, x) = Cells(x, cnt).Value Next x cnt = cnt + 1 Loop End With End Sub On Mar 6, 4:39 pm, Hopeless inChicago wrote: Hello, This is my first time doing this, so please forgive my lack of knowledge. I am trying to copy information from a sheet in excel to another, so I did a record macro and performed the operations....problem is, I need this repeated until all the data is done. Present Layout: Column A ColumnB ColumnC, etc SalesOrder 1234 5678 PONumber 6678 1111 InvoiceDate 12/22/07 12/22/47 RequiredSipDate 08/12/07 01/01/2008 And I'd like it to look like this SalesOrder PONumber InvoiceDate RequiredSipDate 1234 6678 12/22/07 08/12/07 5678 1111 12/22/47 01/01/07 and I'd like the Macro/Program to run until there is no more info in the sales order row of the original layout. Help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
set up a macro to copy/ move sheets to individual files | Excel Programming | |||
Need Simple Copy and Insert Row, Move Down Macro | Excel Programming | |||
how to move data down a column, and copy it into a row | Excel Discussion (Misc queries) | |||
Macro to copy cells one row up then move down 4 rows & repeat | Excel Programming | |||
Converting Lotus 123 macro to Excel - copy/move data to worksheet | Excel Programming |