Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to take a table and save a number of the columns on separate worksheets. I would like these worksheets to be named the date that is the header of the column. Is there a way i can do this without manually naming them??

Thanks
 
Andy M,

Select a single cell in your table, and run a sub like this: you'll need to
come up with a conditional statement to determine which of the columns to
export to their own sheet.

Sub TryNow()
Dim myCol As Range
For Each myCol In ActiveCell.CurrentRegion.Columns
Worksheets.Add.Name = myCol.Cells(1).Value
myCol.Copy Range("A1")
Next
End Sub

HTH,
Bernie
MS Excel MVP

Andym said:
I am trying to take a table and save a number of the columns on separate
worksheets. I would like these worksheets to be named the date that is the
header of the column. Is there a way i can do this without manually naming
them??
 
Back
Top