Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Nov 20, 2:59*pm, jason wrote:
On Nov 20, 2:17*pm, "Luc Ferrari" wrote: I want to create a new "tab, worksheet or whatever you call it " (in excel 2003) if one or more cells in a range contain a value. The code starts after i hit a "button". And name the sheet after the value of the cell left of the first cell of that range. I have no clue in how to program this. Can someone provide me the code for this.... Thanks for your help Luc a finite range? ie: cells A1:A20 or an infinite range? if finite: sub A() dim i for i=1 to 20 *if thisworkbook.activeshees.cells(i,1)<"" then * * *thisworkbook.sheets.add.name= * * thisworkbook.sheets.cells(i, 1).value 'or thisworkbook.sheets.cells(i,1).text end if next i this should work. EDIT: sub A() dim i for i=1 to 20 if thisworkbook.activeshees.cells(i,1)<"" then thisworkbook.sheets.add.name= thisworkbook.sheets.cells(i, 1).value 'or thisworkbook.sheets.cells(i,1).text exit sub end if next i the above code will add one worksheet per non-empty cell. this will add only one for the first non-empty value found in cells A1:A20 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using Macro how to create email link for the email addresses in aRange or Selection | Excel Worksheet Functions | |||
Create a new worksheet (excel 2003) if one or more cells in a range is not empty | Excel Programming | |||
Excel 2003 attachments open and show only empty cells when openedvia Outlook 2003? | Excel Discussion (Misc queries) | |||
Excel 2003 - Create Copy of Worksheet not working | Excel Discussion (Misc queries) | |||
Create an identical Chart Worksheet in Excel 2003 | Charts and Charting in Excel |