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 |
All times are GMT +1. The time now is 10:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com