LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Create Multiple Sheets

My bad - forgot that the sheetname can't have a slash in it. I was trying to
name your sheets with the date. If you want to try that, you can try


sh.Name = format(ar(1).Value,"yyyymmdd")

perhaps.

--
Regards,
Tom Ogilvy




"THE_RAMONES" wrote:

Got it.... It was naming of sheets that needed to be commented. Out . I
apprecate help... It worked great... Code I used is below

Sub DisperseData()
Dim rng As Range, ar As Range
Dim sh As Worksheet
With Worksheets("Master")
Set rng = Columns(1).SpecialCells(xlConstants)
End With
For Each ar In rng.Areas
Set sh = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
'sh.Name = ar(1).Number
ar.EntireRow.Copy Destination:=sh.Range("A1")
Next
End Sub





"THE_RAMONES" wrote:

Tom

We are almost there... I'm getting an Error "Application-defined" or object
defined error.... Here is what I have so far..

Sub DisperseData()
Dim rng As Range, ar As Range
Dim sh As Worksheet
With Worksheets("Master")
Set rng = Columns(1).SpecialCells(xlConstants)
End With
For Each ar In rng.Areas
Set sh = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
sh.Name = ar(1).Text
ar.EntireRow.Copy Destination:=sh.Range("A1")
Next
End Sub


Thanks Again..

"Tom Ogilvy" wrote:

a last minute change. Apparently incomplete. should be

set sh = Worksheets.Add( After:=Worksheets(Worksheets.count))

--
Regards,
Tom Ogilvy

"THE_RAMONES" wrote:

Tom

I get a syntax error on
set sh = Worksheets.Add After:=Worksheets(Worksheets.count)

Any thoughts... Thanks again for the help

"Tom Ogilvy" wrote:

Assume all the dates are unique:

Sub DisperseData()
Dim rng as Range, ar as Range
Dim sh as Worksheet
with worksheets("Master")
set rng = columns(1).specialcells(xlconstants)
End with
for each ar in rng.Areas
set sh = worksheets.Add After:=worksheets(worksheets.count)
sh.name = ar(1).Text
ar.entirerow.copy Destination:=sh.Range("A1")
Next
End Sub

--
Regards,
Tom Ogilvy


"THE_RAMONES" wrote:

I know the hot topic is merging multiple sheets into one... I'm trying to
unmerge data. I have spreadsheets that repeat data. So basically I have a
date, the next row contains all the headers. Then the data... A space then
another date headers and its data, so on and so on...

The data can vary, for example a sheet will have data like this
03/01/06 - A1, Headers A2, Data A3: AA45,
03/02/06 - A47, headers A48, Data A49: AA59

The two things that are constant the headers length, they will always go
from A3:AA45 and there is always one space between the end of the data and
the beginning of the next set.

I would like to create a macro that grabs the date and all its data to the
next space and places it in its own sheet and continue doing it until no more
data is left in the original sheet... So I would end up with 47 sheets for
example. Please help. Thanks

Ramon

 
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 sheets using info from one olson_jr Excel Discussion (Misc queries) 2 December 29th 09 07:55 PM
Create and name multiple sheets MikeD1224 Excel Discussion (Misc queries) 15 March 9th 07 06:08 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
How to create workbook with multiple sheets control freak Excel Discussion (Misc queries) 0 July 19th 06 06:54 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM


All times are GMT +1. The time now is 11:26 PM.

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"