Hello,
We get an excel data sheet sent to us weekly that has security information all on one excel worksheet - each security has two columns (ie - A:B, C:D, E:F, etc etc), and we need to copy each security to its own worksheet and save that sheet as a text file for my company to import this data into our accounting software. Now, this could be upwards of 250 columns, or 125 worksheets. Is it possible to automate this? I have mocked up what it would look like for columns A:B -> Sheet2, I just don't know how to proceed to get it to loop so that columns C:D copy to Sheet3 and so on.
Any thoughts would be greatly appreciated.
Thanks,
Mike
We get an excel data sheet sent to us weekly that has security information all on one excel worksheet - each security has two columns (ie - A:B, C:D, E:F, etc etc), and we need to copy each security to its own worksheet and save that sheet as a text file for my company to import this data into our accounting software. Now, this could be upwards of 250 columns, or 125 worksheets. Is it possible to automate this? I have mocked up what it would look like for columns A:B -> Sheet2, I just don't know how to proceed to get it to loop so that columns C:D copy to Sheet3 and so on.
Code:
Sub DataMove() Columns("A:B").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("C2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "'"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C14")
Range("C2:C14").Select
Range("A2:C14").Select
Range("C14").Activate
End Sub
Any thoughts would be greatly appreciated.
Thanks,
Mike