PDA

View Full Version : Solved: Trim the fat



ndendrinos
07-23-2008, 05:35 AM
Hello, I tried to "trim the fat" from this code to no avail.
Keeping in mind that there is no need to filter the data as column A will always be a unique number AND that there are no headers ,what parts of the code can be deleted and still have a new sheet created for each row of the active sheet (without headers as in S1 when code is run)?

Thank you

mdmackillop
07-23-2008, 07:34 AM
How about

Sub MakeSheets()
Dim cel As Range, sh As Worksheet
For Each cel In Range("Sheet1!A:A")
If cel = "" Then Exit Sub
Set sh = Sheets.Add
sh.Name = cel
Next
End Sub

ndendrinos
07-23-2008, 08:50 AM
Sorry for the delay, my wife took me for a walk.
Thank you for the simplified code mdmackillop can you further help so that each new sheet would pickup the data of the corresponding row?
Many thanks
Nick

mdmackillop
07-23-2008, 09:05 AM
sh.Name = cel
sh.Rows("1:1").Value = cel.EntireRow.Value

ndendrinos
07-23-2008, 09:18 AM
Yes it is perfect now.
Thank you for your help,
Nick
I'll mark it "solved" as soon as I find the darn button