ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dynamic worksheet select (https://www.excelbanter.com/excel-programming/380822-re-dynamic-worksheet-select.html)

Don Guillett

dynamic worksheet select
 
or
Sub gotodate()' testing
x = Day([md]) & " - data"
MsgBox x
Application.Goto Sheets(x).Range("a1")
End Sub

Sub gotodate()
Application.Goto Sheets(Day(Date) & " - data").Range("a1")
End Sub
--
Don Guillett
SalesAid Software

"Sjakkie" wrote in message
...
Never mind...lol


Dim test1
If Day(Date) <= 10 Then
test1 = "0" & Day(Date) & " - Data"
Else
test1 = Day(Date) & " - Data"
End If
Sheets(test1).Activate
Cells(1, 1).Select

"Sjakkie" wrote:

how can i select a worksheet based on todays date.
i have sheets that are name 1-31 in the worksheet.

eg:
"1 - Data" , "2 - Data" , "3 - Data" etc......

How can i select the sheet for the current date...

something like

test1 = day(date) & " - Data"
Sheets(test1).Activate
Cells(1, 1).Select





All times are GMT +1. The time now is 06:29 AM.

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