LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Create multiple worksheets

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, 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 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


 
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
Create multiple worksheets from list KDP Excel Discussion (Misc queries) 11 April 2nd 07 04:27 PM
Create List from Multiple Worksheets David Excel Programming 6 February 15th 07 07:32 PM
How do I create an overall graph from Multiple worksheets? Worksheet functions Excel Worksheet Functions 0 June 29th 06 04:25 AM
create & name multiple worksheets OrlaH Excel Worksheet Functions 5 June 8th 06 03:19 PM
Create Multiple Worksheets from One Kdub via OfficeKB.com Excel Programming 3 June 20th 05 08:26 PM


All times are GMT +1. The time now is 09:54 AM.

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

About Us

"It's about Microsoft Excel"