ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   move columns to separate worksheets (https://www.excelbanter.com/excel-programming/403945-move-columns-separate-worksheets.html)

amanda

move columns to separate worksheets
 
Hello,

I have large amounts of imported data that I would like to separate
onto indivual tabs based on the header name. Is there a non-manual
way to do so?

Thanks,
Amanda

joel

move columns to separate worksheets
 
Sub test()

Set oldsht = ActiveSheet
ColCount = 1
Do While oldsht.Cells(1, ColCount) < ""
Worksheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = oldsht.Cells(1, ColCount).Value
Set newsht = ActiveSheet
oldsht.Columns(ColCount).Copy _
Destination:=newsht.Columns("A:A")

ColCount = ColCount + 1
Loop

End Sub


"amanda" wrote:

Hello,

I have large amounts of imported data that I would like to separate
onto indivual tabs based on the header name. Is there a non-manual
way to do so?

Thanks,
Amanda



All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com