Cut then paste Columns of Data into a new tab

hgufrin

Board Regular
Joined
Apr 19, 2004
Messages
177
Office Version
  1. 365
Platform
  1. Windows
Hi. Thanks in advance for your help.

Can you please provide me with the code to cut and paste data for each entity into a new individual tab? Also please include Column A into each tab.

There are only 3 entities here. But at times there can be 30 entities.

Sincerely appreciate your help.
 

Attachments

  • MrExcelHelp.png
    MrExcelHelp.png
    44.1 KB · Views: 11

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I found this... But the problem is... it will only separate data limited to one column. My entities have two column per entity.

1707512045916.png



Sub copycols1()
Dim LC As Long, i As Long, ws As Worksheet
With ActiveSheet
LC = .Cells(1, Columns.Count).End(xlToLeft).Column
For i = 2 To LC
Set ws = Sheets.Add(After:=Sheets(Sheets.Count))
.Columns(1).Copy Destination:=ws.Range("A1")
.Columns(i).Copy Destination:=ws.Range("B1")
ws.Name = Range("B1").Value
Next i
End With
End Sub
 
Upvote 0
Bump... Hoping that someone can help me out.

... Hoping there is code that would put columns ACD, AFG, AIJ into its own worksheet. And keep doing this until there are not columns left.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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