Results 1 to 2 of 2

Thread: rename the active sheet name after concatenate three criteria in vba
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default rename the active sheet name after concatenate three criteria in vba

    Hi I am not able to change active sheet based on 3 criteria, I have done with first 2 criteria but third one is not able do do.

    1- change tab name according the active workbook
    2 should be add MTD in Sheet name
    3- Add Month name (MMM) based on next sheet cell value.

    Example:- my file name is Neetu and next sheet (sheet name not fixed) Cell C2 value is 8 then my activesheet name should be
    (Neetu MTD Aug)

    I have done with first 2 criteria but third one is not able do do.


    Dim a As String

    With ActiveWorkbook
    ActiveSheet.Name = Left(.Name, Len(.Name) - 4) & " MTD " & response

    End With

    Please help

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,129
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: rename the active sheet name after concatenate three criteria in vba

    How about
    Code:
    Dim Mnth As String
    
    With Sheets(ActiveSheet.Index + 1)
       Mnth = Left(MonthName(.Range("C2")), 3)
    End With
    With ActiveWorkbook
       ActiveSheet.Name = Left(.Name, Len(.Name) - 4) & " MTD " & Mnth
    End With
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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