This code wasn't quite right and it was giving me errors. I found the problem was in this line: " if date(Range("B2").value) =dtdate then "
I corrected it to read " if Range("B2").value=dtdate then " and it works fine! Many Thanks! Doug On May 20, 4:06 am, bala <bal...@gmail.com> wrote: > Hi, > Try this code > > dim dtDate as Date > dtDate = Thisworkbook.Names("IDO_Date"").RefersToRange.Value > > for i = 2 to Sheets.count > sheets(i).select > if date(Range("B2").value)=dtdate then > Exit For > end if > Next > > On May 19, 7:44 pm, Doug <dsrmccl...@gmail.com> wrote: > > > Hello, > > I have a workbook with a separate page for each date. The date is > > always in cell B2. On the first page of the workbook I want to enter > > the date into a cell named "IDO_Date" and click on a button to go to > > the worksheet for that date. Can someone please show me the easiest > > code to assign to the button to do this? > > > Thanks. --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---