Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selecting A Tab By Its Name

Hi All,

I would appreciate any help you can give me on this.

I have a worksheet in excel and on the click of a comand button it
opens another file and gets the values from the cells i want closes
that file and inputs the data to the relevant place in my sheet.

But, i want to be able to select a sheet when i open the file
according to a cell value / date. All the sheets in the other file are
named after the date so, 09.01.08 would be todays sheet name.

I have tried doing the following but it didnt like it:

Dim TheDate As String

TheDate = "=text(now(),""dd.mm.yy"")"

Sheets(TheDate).Select


Any ideas?

Many thanks in advance,

Ash
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Selecting A Tab By Its Name

try this:

dim thedate as string

thedate = format(now(),"dd.mm.yy")

sheets(thedate).select

hth

Carlo

On Jan 9, 5:54*pm, wrote:
Hi All,

I would appreciate any help you can give me on this.

I have a worksheet in excel and on the click of a comand button it
opens another file and gets the values from the cells i want closes
that file and inputs the data to the relevant place in my sheet.

But, i want to be able to select a sheet when i open the file
according to a cell value / date. All the sheets in the other file are
named after the date so, 09.01.08 would be todays sheet name.

I have tried doing the following but it didnt like it:

Dim TheDate As String

TheDate = "=text(now(),""dd.mm.yy"")"

Sheets(TheDate).Select

Any ideas?

Many thanks in advance,

Ash


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selecting A Tab By Its Name

On 9 Jan, 08:57, carlo wrote:
try this:

dim thedate as string

thedate = format(now(),"dd.mm.yy")

sheets(thedate).select

hth

Carlo

On Jan 9, 5:54*pm, wrote:



Hi All,


I would appreciate any help you can give me on this.


I have a worksheet in excel and on the click of a comand button it
opens another file and gets the values from the cells i want closes
that file and inputs the data to the relevant place in my sheet.


But, i want to be able to select a sheet when i open the file
according to a cell value / date. All the sheets in the other file are
named after the date so, 09.01.08 would be todays sheet name.


I have tried doing the following but it didnt like it:


Dim TheDate As String


TheDate = "=text(now(),""dd.mm.yy"")"


Sheets(TheDate).Select


Any ideas?


Many thanks in advance,


Ash- Hide quoted text -


- Show quoted text -


Thankyou both for the fast responses, they both helped.

many thanks
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Selecting A Tab By Its Name

Private Sub Workbook_Open()
ThisWorkbook.Worksheets(Format(Date, "dd.mm.yy")).Activate
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
Hi All,

I would appreciate any help you can give me on this.

I have a worksheet in excel and on the click of a comand button it
opens another file and gets the values from the cells i want closes
that file and inputs the data to the relevant place in my sheet.

But, i want to be able to select a sheet when i open the file
according to a cell value / date. All the sheets in the other file are
named after the date so, 09.01.08 would be todays sheet name.

I have tried doing the following but it didnt like it:

Dim TheDate As String

TheDate = "=text(now(),""dd.mm.yy"")"

Sheets(TheDate).Select


Any ideas?

Many thanks in advance,

Ash



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
row selecting climate Excel Worksheet Functions 3 October 12th 08 05:57 AM
Selecting last row mhayli Excel Programming 2 August 3rd 06 10:28 AM
Selecting Viktor Ygdorff Excel Programming 0 July 17th 06 01:27 PM
Selecting Mark Petruszak Excel Programming 7 August 30th 05 03:41 PM
Selecting The Last Row Minitman[_4_] Excel Programming 15 July 25th 05 03:11 AM


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