Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Syntax to copy and paste dynamic data based on one column
I am trying to move data around from one sheet to another I am currently
using the following: Sub Quotesheet2() 'If each column has a heading, change the 1's to 2's Dim myRange As Range Dim ActSheet As Worksheet Dim newSheet As Worksheet Set ActSheet = ActiveSheet With ActSheet Set myRange = .Range("A1", .Range("A1").End(xlDown)) End With Workbooks.Add Set newSheet = ActiveWorkbook.Sheets("Sheet1") '<-- in the new workbook myRange.Copy _ Destination:=newSheet.Range("C1") With ActSheet Set myRange = .Range("B1", .Range("B1").End(xlDown)) End With myRange.Copy _ Destination:=newSheet.Range("C65536").End(xlUp).Of fset(1) With ActSheet Set myRange = .Range("c1", .Range("c1").End(xlDown)) End With myRange.Copy _ Destination:=newSheet.Range("d1") With ActSheet Set myRange = .Range("d1", .Range("d1").End(xlDown)) End With myRange.Copy _ Destination:=newSheet.Range("d65536").End(xlUp).Of fset(1) End Sub The problem that I am running into is that this data is changing constantly and only one column has data that is consistently complete (column "A"). I am looking for a way to look at column "A" and move data based on the information in column "A" so for example if I have data in column "A" (A1:A10). The macro will put the information from column "B" in column "C" where column "A" left off. It then copies information in column "C" and paste down. It then copies Column "D" and paste where column "C" left off (but I am looking for a way where it will paste the same range as column "A"). Thank You in advance Judd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to copy and paste based on a condition | Excel Discussion (Misc queries) | |||
Copy And Paste Macro Syntax Problem | Excel Worksheet Functions | |||
How do I change column data based on dynamic (rolling) dates? | Excel Discussion (Misc queries) | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Charts and Charting in Excel | |||
Copy/Paste Macro and Column Sizing | Excel Programming |