Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to make each column of data a new worksheet?

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to make each column of data a new worksheet?

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = 2 To lngLastCol Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to make each column of data a new worksheet?

Thanks Jacob - sorry to be so dense, but what is supposed to happen when I
run the macro?

"Jacob Skaria" wrote:

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = 2 To lngLastCol Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to make each column of data a new worksheet?

would like to extract Columns A and B into one worksheet, then Columns A
and
C, then Columns A and D etc, all into new worksheets in the same workbook without having to manually copy and paste each of them.


As mentioned above; the macro would create new sheets by copying information
from ColA/B, ColA/C, ColA/D etc; from the active sheet

If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Thanks Jacob - sorry to be so dense, but what is supposed to happen when I
run the macro?

"Jacob Skaria" wrote:

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = 2 To lngLastCol Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to make each column of data a new worksheet?

I'm sorry Jacob - I can't make it work :( Nothing is happening when I run the
Macro - no new worksheets are appearing.

"Jacob Skaria" wrote:

would like to extract Columns A and B into one worksheet, then Columns A

and
C, then Columns A and D etc, all into new worksheets in the same workbook without having to manually copy and paste each of them.


As mentioned above; the macro would create new sheets by copying information
from ColA/B, ColA/C, ColA/D etc; from the active sheet

If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Thanks Jacob - sorry to be so dense, but what is supposed to happen when I
run the macro?

"Jacob Skaria" wrote:

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = 2 To lngLastCol Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to make each column of data a new worksheet?

Oops.my mistake...try this version

Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = lngLastCol To 2 Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

I'm sorry Jacob - I can't make it work :( Nothing is happening when I run the
Macro - no new worksheets are appearing.

"Jacob Skaria" wrote:

would like to extract Columns A and B into one worksheet, then Columns A

and
C, then Columns A and D etc, all into new worksheets in the same workbook without having to manually copy and paste each of them.


As mentioned above; the macro would create new sheets by copying information
from ColA/B, ColA/C, ColA/D etc; from the active sheet

If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Thanks Jacob - sorry to be so dense, but what is supposed to happen when I
run the macro?

"Jacob Skaria" wrote:

You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub SplitSheet()
Dim ws1 As Worksheet, ws2 As Worksheet, lngCol As Long, lngLastCol As Long
Set ws1 = ActiveSheet
lngLastCol = ws1.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
For lngCol = 2 To lngLastCol Step -1
Set ws2 = Worksheets.Add(After:=ws1)
ws1.Columns(1).Copy ws2.Columns(1)
ws1.Columns(lngCol).Copy ws2.Columns(2)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"AbiC" wrote:

Hello,

I was hoping somebody could help me with an Excel problem - I am not a very
advanced excel user but I am hoping someone can give me some simplified
advice.

Basically I have got an Excel 2007 worksheet with 250 odd columns and I need
to split each column of existing data onto a new worksheet. Column A is
actually my list of headings, so ideally I would like to extract Columns A
and B into one worksheet, then Columns A and C, then Columns A and D etc, all
into new worksheets in the same workbook without having to manually copy and
paste each of them.

I am starting to suspect that this may require a macro or similar (which is
way over my head) but if you have any ideas I would love to hear them.

I hope that makes sense!

Thank you.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a column not allow new data for monthly report? Municorn1977 Excel Discussion (Misc queries) 5 October 7th 07 01:17 AM
How do I make a column of data sort into rows? Cara Excel Worksheet Functions 5 January 25th 07 04:37 AM
How do i make cells in one worksheet copy certain data to another Shar Excel Worksheet Functions 3 June 29th 06 11:25 PM
Using a column of data from 1 worksheet to extract data from another worksheet [email protected] Excel Worksheet Functions 2 February 23rd 06 04:33 PM
how do I make a copy of a worksheet and retain formulas but not data FireBrick Setting up and Configuration of Excel 2 December 29th 04 07:33 PM


All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"