Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Setting worksheet name equal to variable value

I have several worksheets in my workbook and need to input information
into a worksheet based on the date entered by the user. the worksheets
are name 01-Dec-06 up too 31-Dec-06 in order. The user in most cases
will enter the information in order meaning after they enter the
information on the 1st they will then input the information on the 2nd.
But they could possibly do them out of order if they wanted. That is
why I am trying to select the worksheet based on the date entered since
the worksheet names and the date entered are formated the same. Here is
my process so far for doing this.

I have a Variable newwrksheet and a Variable of type string called
TodaysDate

I have tried worksheets(newwrksheets).name = TodaysDate and it gives me
an error because the types are a mismatch.



Any Help would be greatly appreaciated

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Setting worksheet name equal to variable value

Are you trying to select that entered worksheet if so try

worksheets(format(TodaysDate, "dd-mm-yy")).select

you say that the names of the worksheets are already the dates so

worksheets(format(TodaysDate, "dd-mm-yy")).name = format(TodaysDate,
"dd-mm-yy")

will just set the name the same.

Please explain for if you need further help.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"newguy" wrote:

I have several worksheets in my workbook and need to input information
into a worksheet based on the date entered by the user. the worksheets
are name 01-Dec-06 up too 31-Dec-06 in order. The user in most cases
will enter the information in order meaning after they enter the
information on the 1st they will then input the information on the 2nd.
But they could possibly do them out of order if they wanted. That is
why I am trying to select the worksheet based on the date entered since
the worksheet names and the date entered are formated the same. Here is
my process so far for doing this.

I have a Variable newwrksheet and a Variable of type string called
TodaysDate

I have tried worksheets(newwrksheets).name = TodaysDate and it gives me
an error because the types are a mismatch.



Any Help would be greatly appreaciated


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Setting worksheet name equal to variable value

That worked Thank You

Martin Fishlock wrote:
Are you trying to select that entered worksheet if so try

worksheets(format(TodaysDate, "dd-mm-yy")).select

you say that the names of the worksheets are already the dates so

worksheets(format(TodaysDate, "dd-mm-yy")).name = format(TodaysDate,
"dd-mm-yy")

will just set the name the same.

Please explain for if you need further help.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"newguy" wrote:

I have several worksheets in my workbook and need to input information
into a worksheet based on the date entered by the user. the worksheets
are name 01-Dec-06 up too 31-Dec-06 in order. The user in most cases
will enter the information in order meaning after they enter the
information on the 1st they will then input the information on the 2nd.
But they could possibly do them out of order if they wanted. That is
why I am trying to select the worksheet based on the date entered since
the worksheet names and the date entered are formated the same. Here is
my process so far for doing this.

I have a Variable newwrksheet and a Variable of type string called
TodaysDate

I have tried worksheets(newwrksheets).name = TodaysDate and it gives me
an error because the types are a mismatch.



Any Help would be greatly appreaciated



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
problem with setting the worksheet variable ws Janis Excel Discussion (Misc queries) 4 January 17th 08 02:21 PM
Setting varible to equal values of a # of cells mozart[_8_] Excel Programming 6 April 15th 06 11:32 PM
Setting a cell equal to another worksheet cell fails (sometimes) Richard Excel Worksheet Functions 2 March 10th 06 04:11 AM
Setting zoom of 2 sheets equal jbl25[_5_] Excel Programming 2 June 28th 05 05:40 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM


All times are GMT +1. The time now is 10:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"