PC Review


Reply
Thread Tools Rate Thread

Create multiple worksheets

 
 
John
Guest
Posts: n/a
 
      30th Jul 2008
Looking for some help creating a macro that will sort through a list and
create a worksheet for each entry in a column. The data lists about 30-40
names mutiple times in several hundred entries. I need to create a new
worksheet titled with that persons name.

Thanks in advance! (Using Excel 2003)
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      30th Jul 2008
Start here John
http://www.rondebruin.nl/copy5.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"John" <(E-Mail Removed)> wrote in message news:305E20EE-B834-4E7A-A008-(E-Mail Removed)...
> Looking for some help creating a macro that will sort through a list and
> create a worksheet for each entry in a column. The data lists about 30-40
> names mutiple times in several hundred entries. I need to create a new
> worksheet titled with that persons name.
>
> Thanks in advance! (Using Excel 2003)

 
Reply With Quote
 
GTVT06
Guest
Posts: n/a
 
      30th Jul 2008
Hello, this will do it if you data is in column A

Sub sheets()
Dim LRow As Long
LRow = ActiveSheet.Range("A65536").End(xlUp).Row
Dim cell As Range
For Each cell In Range("A1:A" & LRow)
If cell.Value > "" Then
Worksheets.Add().Name = cell.Value
End If
Next cell
End Sub
 
Reply With Quote
 
sbitaxi@gmail.com
Guest
Posts: n/a
 
      30th Jul 2008
GTVT06 - won't that create a new worksheet for every cell in column A,
even if it a worksheet has been created for that value? He could end
up with thousands!


On Jul 30, 5:39*pm, GTVT06 <gtv...@hotmail.com> wrote:
> Hello, this will do it if you data is in column A
>
> Sub sheets()
> Dim LRow As Long
> * * LRow = ActiveSheet.Range("A65536").End(xlUp).Row
> Dim cell As Range
> * * For Each cell In Range("A1:A" & LRow)
> * * * * If cell.Value > "" Then
> * * * * Worksheets.Add().Name = cell.Value
> * * * * End If
> * * Next cell
> End Sub


 
Reply With Quote
 
sbitaxi@gmail.com
Guest
Posts: n/a
 
      30th Jul 2008
Sub Sheets()
Dim Rng as Range
Dim WS1 as Worksheet
Dim WS2 as Worksheet
Dim LRow As Long


Set WS1 = ActiveSheet
Set WS2 = Worksheets.Add
Set Rng = WS1.Range("A1:YOUR LAST COLUMN OF DATA" & Rows.Count)

' Creates list of unique values
With WS2
Rng.Columns(FieldNum).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("A1"), Unique:=True

' Creates worksheets from unique values
LRow = WS2.Range("A65536").End(xlUp).Row
Dim cell As Range
For Each cell In Range("A1:A" & LRow)
If cell.Value > "" Then
Worksheets.Add().Name = cell.Value
End If
Next cell
End Sub




On Jul 30, 5:58*pm, sbit...@gmail.com wrote:
> GTVT06 - won't that create a new worksheet for every cell in column A,
> even if it a worksheet has been created for that value? He could end
> up with thousands!
>
> On Jul 30, 5:39*pm, GTVT06 <gtv...@hotmail.com> wrote:
>
> > Hello, this will do it if you data is in column A

>
> > Sub sheets()
> > Dim LRow As Long
> > * * LRow = ActiveSheet.Range("A65536").End(xlUp).Row
> > Dim cell As Range
> > * * For Each cell In Range("A1:A" & LRow)
> > * * * * If cell.Value > "" Then
> > * * * * Worksheets.Add().Name = cell.Value
> > * * * * End If
> > * * Next cell
> > End Sub


 
Reply With Quote
 
GTVT06
Guest
Posts: n/a
 
      31st Jul 2008
On Jul 30, 4:58*pm, sbit...@gmail.com wrote:
> GTVT06 - won't that create a new worksheet for every cell in column A,
> even if it a worksheet has been created for that value? He could end
> up with thousands!
>
> On Jul 30, 5:39*pm, GTVT06 <gtv...@hotmail.com> wrote:
>
>
>
> > Hello, this will do it if you data is in column A

>
> > Sub sheets()
> > Dim LRow As Long
> > * * LRow = ActiveSheet.Range("A65536").End(xlUp).Row
> > Dim cell As Range
> > * * For Each cell In Range("A1:A" & LRow)
> > * * * * If cell.Value > "" Then
> > * * * * Worksheets.Add().Name = cell.Value
> > * * * * End If
> > * * Next cell
> > End Sub- Hide quoted text -

>
> - Show quoted text -


your right, I forgot he said he would have them listed multiple times,
I wrote that expecting there were no duplicates.
 
Reply With Quote
 
sbitaxi@gmail.com
Guest
Posts: n/a
 
      31st Jul 2008
No problem, I borrowed your code to finish it, however I forgot to
delete the filter sheet.

John, if you're still looking, add this line at the end

WS2.Delete

On Jul 30, 7:59*pm, GTVT06 <gtv...@hotmail.com> wrote:
> On Jul 30, 4:58*pm, sbit...@gmail.com wrote:
>
>
>
> > GTVT06 - won't that create a new worksheet for every cell in column A,
> > even if it a worksheet has been created for that value? He could end
> > up with thousands!

>
> > On Jul 30, 5:39*pm, GTVT06 <gtv...@hotmail.com> wrote:

>
> > > Hello, this will do it if you data is in column A

>
> > > Sub sheets()
> > > Dim LRow As Long
> > > * * LRow = ActiveSheet.Range("A65536").End(xlUp).Row
> > > Dim cell As Range
> > > * * For Each cell In Range("A1:A" & LRow)
> > > * * * * If cell.Value > "" Then
> > > * * * * Worksheets.Add().Name = cell.Value
> > > * * * * End If
> > > * * Next cell
> > > End Sub- Hide quoted text -

>
> > - Show quoted text -

>
> your right, I forgot he said he would have them listed multiple times,
> I wrote that expecting there were no duplicates.


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      1st Aug 2008
Thanks Ron...this worked perfectly!

"Ron de Bruin" wrote:

> Start here John
> http://www.rondebruin.nl/copy5.htm
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "John" <(E-Mail Removed)> wrote in message news:305E20EE-B834-4E7A-A008-(E-Mail Removed)...
> > Looking for some help creating a macro that will sort through a list and
> > create a worksheet for each entry in a column. The data lists about 30-40
> > names mutiple times in several hundred entries. I need to create a new
> > worksheet titled with that persons name.
> >
> > Thanks in advance! (Using Excel 2003)

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create multiple worksheets from list =?Utf-8?B?S0RQ?= Microsoft Excel Misc 11 2nd Apr 2007 04:27 PM
Create List from Multiple Worksheets =?Utf-8?B?RGF2aWQ=?= Microsoft Excel Programming 6 15th Feb 2007 07:32 PM
How do I create an overall graph from Multiple worksheets? =?Utf-8?B?V29ya3NoZWV0IGZ1bmN0aW9ucw==?= Microsoft Excel Worksheet Functions 0 29th Jun 2006 04:25 AM
create & name multiple worksheets =?Utf-8?B?T3JsYUg=?= Microsoft Excel Worksheet Functions 5 8th Jun 2006 03:19 PM
Create Multiple Worksheets from One Kdub via OfficeKB.com Microsoft Excel Programming 3 20th Jun 2005 08:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:04 AM.