+ Reply to Thread
Results 1 to 3 of 3

Changing a sheet name to the current date

  1. #1
    Reddist
    Guest

    Changing a sheet name to the current date

    Hi. I am trying to rename a new sheet to the current date, using the
    "15-Mar-06" format, but I keep getting an error whenever I hit this line of
    code:

    ActiveSheet.Name = ActiveSheet.Range("H3").Value

    ....where H3.value is the current date. I think its seeing the "/"s in the
    date and not wanting to accept the value, even though I have a line above
    where I change the format of the date in that H3 cell. Name = Date doesn't
    work either, I think for the same reason.

    Any ideas?

    thanks oodles!

  2. #2
    Eric White
    Guest

    RE: Changing a sheet name to the current date

    Try this:

    ActiveSheet.Name = Format(ActiveSheet.Range("H3").Value,"dd-mmm-yy")



    "Reddist" wrote:

    > Hi. I am trying to rename a new sheet to the current date, using the
    > "15-Mar-06" format, but I keep getting an error whenever I hit this line of
    > code:
    >
    > ActiveSheet.Name = ActiveSheet.Range("H3").Value
    >
    > ...where H3.value is the current date. I think its seeing the "/"s in the
    > date and not wanting to accept the value, even though I have a line above
    > where I change the format of the date in that H3 cell. Name = Date doesn't
    > work either, I think for the same reason.
    >
    > Any ideas?
    >
    > thanks oodles!


  3. #3
    Reddist
    Guest

    RE: Changing a sheet name to the current date

    That works perfectly. Thanks!

    "Eric White" wrote:

    > Try this:
    >
    > ActiveSheet.Name = Format(ActiveSheet.Range("H3").Value,"dd-mmm-yy")
    >
    >
    >
    > "Reddist" wrote:
    >
    > > Hi. I am trying to rename a new sheet to the current date, using the
    > > "15-Mar-06" format, but I keep getting an error whenever I hit this line of
    > > code:
    > >
    > > ActiveSheet.Name = ActiveSheet.Range("H3").Value
    > >
    > > ...where H3.value is the current date. I think its seeing the "/"s in the
    > > date and not wanting to accept the value, even though I have a line above
    > > where I change the format of the date in that H3 cell. Name = Date doesn't
    > > work either, I think for the same reason.
    > >
    > > Any ideas?
    > >
    > > thanks oodles!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1