Consulting

Results 1 to 3 of 3

Thread: Making the date column read left letters from sheet name

  1. #1
    VBAX Newbie
    Joined
    Oct 2022
    Posts
    1
    Location

    Making the date column read left letters from sheet name

    Hello,

    I am trying to find a solution for my issue,
    I created a micro that insert date column and fill it, now I need to make the date=activatesheet name but I couldn’t

    my code is below

    Aprils=activatsheet.name(left,7)

    the result coming as “Aprils” instead of the date.

    please let me know where is my mistake or the alternative solution.
    appreciate the support.

  2. #2
    Moderator VBAX Guru Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    4,240
    Location
    Your use of Aprils = Activesheet.name is setting the name of the active sheet to "Aprils" so when you use Activesheet.Name(Left,7) it simply returns 7 characters from the left of the sheet name "Aprils" hence the returned value Aprils
    Remember To Do the Following....
    Use tags when posting code to the thread,
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    VBAX Expert
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    857
    Location
    Maybe:
    Aprils = Left(ActiveSheet.Name, 7)
    If you want to make the active sheet name become todays date then maybe:
    ActiveSheet.Name = Format(Date, "yyyy.mm.dd")
    If things don't change they stay the same
    Quite often there is a picnic problem (problem in chair not in computer)
    "We were not told it was impossible, so we did it."

Posting Permissions

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