Copy column to new sheet and rename sheet with column header

RoryF

New Member
Joined
Oct 10, 2022
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
Hi,
Apologies in advance if this has been asked before i couldn't find the solution in was looking for.

I have a sheet with 100's of columns, each column has different amount of rows and a header. What i am trying to achieve is have each column copied to it's own sheet and the name of the sheet named with the column header, i've tried a few macro's but none meet my need.

Can anyone help with a macro that would help me achieve this?

Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Welcome to the forum. :)

Do you want new sheets added in the same workbook, or to a new workbook?
 
Upvote 0
Thanks for the reply.

I would like them on the same workbook if possible.
 
Upvote 0
Try this:

VBA Code:
Sub copyToSheets()
   Dim sourceSheet As Worksheet
   Set sourceSheet = ActiveSheet
   
   Application.ScreenUpdating = False
   
   With sourceSheet.UsedRange
   
      Dim colNum As Long
      For colNum = 1 To .Columns.Count
         copyToNewSheet .Columns(colNum)
      Next colNum
      
   End With
   
   sourceSheet.Activate
   
   Application.ScreenUpdating = True
End Sub
Sub copyToNewSheet(sourceRange As Range)

   With sourceRange.Worksheet
   
      Dim lastRow As Long
      lastRow = .Cells(.Rows.Count, sourceRange.Column).End(xlUp).Row
      
      With .Parent.Worksheets
         Dim newSheet As Worksheet
         Set newSheet = .Add(after:=.Item(.Count))
      End With
      
   End With
   newSheet.Name = sourceRange.Cells(1).Value
      
   sourceRange.Resize(lastRow - sourceRange.Row + 1).Copy newSheet.Range("A1")
      
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,519
Messages
6,125,299
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top