Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default new worksheets based on list

Hi Everyone,

I've been having a problem trying to do something I believed would be
easy. I have a list of dates and numbers. I want to have a script
that, by default, would match today's date with the dates in the list,
and for each matching date, create a new worksheet named the number.
If anyone can give me some assistance, I would appreciate it very
much.

Thanks,
Tanama


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default new worksheets based on list

One way is to just loop through your list:

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range
Dim wks As Worksheet

For Each myCell In Worksheets("sheet1").Range("a1:a20").Cells
If myCell.Value2 = CLng(Date) Then
Set wks = Worksheets.Add
On Error Resume Next
wks.Name = myCell.Offset(0, 1).Text '.value???
If Err.Number < 0 Then
MsgBox "Renamed failed for sheet: " & wks.Name
Err.Clear
End If
On Error GoTo 0
End If
Next myCell

End Sub




"tanama <" wrote:

Hi Everyone,

I've been having a problem trying to do something I believed would be
easy. I have a list of dates and numbers. I want to have a script
that, by default, would match today's date with the dates in the list,
and for each matching date, create a new worksheet named the number.
If anyone can give me some assistance, I would appreciate it very
much.

Thanks,
Tanama

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

Reply
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
Extract list of units based on error criteria to new list Sheila Excel Worksheet Functions 0 August 9th 07 01:50 AM
how do I generate lists in worksheets based on a master list works Furlong Excel Worksheet Functions 10 July 15th 07 09:36 AM
Separating a List onto multiple worksheets in the same workbook based off 1 criteria DMRbaxter Excel Worksheet Functions 6 April 19th 07 01:36 PM
Creating number of worksheets based on list Sunnyskies Excel Discussion (Misc queries) 0 October 23rd 06 10:11 AM
Can you sort a list based on catagory names without useing a custom list? BobbyFlanigan Excel Programming 2 July 29th 04 02:49 AM


All times are GMT +1. The time now is 10:02 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"