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,132
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,674
Messages
5,335,603
Members
399,028
Latest member
greyland

Some videos you may like

This Week's Hot Topics

Top