• We are receiving reports of members using the private messaging service (Conversations) in ways that break the forum rules:
    • Do not invite another member to take the question off the forum (i.e. do not suggest that they post to a different forum, do not suggest that they email or private message you the problem, do not simply post a link to another forum, unless it is to a specific, relevant, thread). This applies equally to members asking or answering questions.
    • Soliciting business for yourself is not permitted. This is an all volunteer board, so offering solutions in exchange for compensation is not permitted. Likewise, members seeking solutions must not offer compensation for them. If you have an urgent need, check the Consulting Services page.
    Please help us out by clicking the Report link on any messages you receive that violate these rules. Thank you
  • If you would like to post, please check out the MrExcel Message Board FAQ and click here to register.
    If you forgot your password, you can reset your password.

rename the active sheet name after concatenate three criteria in vba

nkashyap3

New Member
Joined
Jun 27, 2019
Messages
17
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,305
Office Version
365
Platform
Windows
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
 

Forum statistics

Threads
1,077,967
Messages
5,337,448
Members
399,147
Latest member
Raviteja KOTHA

Some videos you may like

This Week's Hot Topics

Top