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 Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,110
    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 [Code].... [/Code] 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
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,218
    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")
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2404, Build 17531.20140

Posting Permissions

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