Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-05-2015, 02:30 AM
macropod's Avatar
macropod macropod is offline How to refer to a variable with BLANKs Windows 7 64bit How to refer to a variable with BLANKs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So, given that today's date is 05.11.2015, if a sheet named "Data Input 05.11.2015" doesn't exist, you'll get a 'subscript out of range' error... There's also the question of whether the Date keyword on your system returns dates expressed in the DD.MM.YYYY format.

Even so, you shouldn't need to activate a worksheet to work with it. For example:
Code:
Sub Test()
Dim v_Sheetname As String
v_Sheetname = "Data Input " & Format(Date, "DD.MM.YYYY")
MsgBox Sheets(v_Sheetname).Range("A1").Value
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to refer to a variable with BLANKs Counting Blanks in 1 Column and Non-Blanks in Another dogwood705 Excel 4 02-07-2015 08:45 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
How to refer to a variable with BLANKs Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
How to refer to a variable with BLANKs object variable or with block variable not set MJP143 Excel 1 02-11-2013 05:07 AM
How to refer to a variable with BLANKs Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft