Move Text to Column in Excel with VB Script
I have a large excel spreadsheet with records. Each record is 12 rows. I
need them moved to columns. Every twelve rows need to be copied into the
same column matching up. Each row will be its own column. I need the
script to open the workbook, execute the task, then save the workbook with
the new arrangement.
The spreadsheet is very large, so I need for the script to loop all the
way thru the sheet. At the end of the script I want the first twelve rows
to be 1 record spread across 12 columns. This is what I have thus far:
Dim x|App Dim x|Sheet1 Dim x|Book1
Set x|App = CreateObject("Excel.Application") x|App.Workbooks.Open
"C:\users\am2878\desktop\Exchange Audit Log.xls"
Set x|Book1 = x|App.Workbooks("Exchange Audit Log.xls") Set x|Sheet1 +
x|Book1.Worksheet("Exchange Audit Log")
x|App.Application.Visible = True
x|Sheet1.Range("A1:A12").Cut
x|Sheet1.Range("A1:L1").Paste
Loop
x|Book1.SaveAs "C:\users\am2878\desktop\Exchange Audit Log.xls", x|Normal,
"","",False,False x|App.Quit
No comments:
Post a Comment