ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trying to create sheets and tab names from first colum of data (https://www.excelbanter.com/excel-programming/429733-re-trying-create-sheets-tab-names-first-colum-data.html)

Ron de Bruin

trying to create sheets and tab names from first colum of data
 
Hi Nelson

See
http://www.rondebruin.nl/copy5.htm



"Nelson" schreef in bericht
...
I have a DB result sheet, now I am trying to create worksheets for each
individual customer number in the first column of my datasheet and give
the
tab of that worksheet the customer number.

I am using this but it doesnt seem to be working


Sub CreateSheetsFromAList()
Dim MyCell As Range, MyRange As Range

Set MyRange = Sheets("RawData").Range("RawData!L:L")
Set MyRange = Range(MyRange, MyRange.End(xlDown))

For Each MyCell In MyRange

Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Next MyCell
End Sub

what I am looking for it to do is go through my rawdata in column A and
create a worksheet (giving the tab the name of the cusotmer number), I
also
wanted this to skip existing customer numbers where a sheet already exists
and move on till its done.

Any thoughts?

Thanks in advance


--
Nelson

__________ Information from ESET Smart Security, version of virus
signature database 4149 (20090611) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus signature database 4149 (20090611) __________

The message was checked by ESET Smart Security.

http://www.eset.com





All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com