Sheet Names

Jborg

Board Regular
Joined
Feb 3, 2012
Messages
180
Office Version
  1. 365
Platform
  1. Windows
Might be possible with VBA??

I have a workbook with 12 sheets for every Month. Sheet Names are January-2019 etc all the way to December-2019

In every sheet in cell R3 i have written 2019.

Is there a way to change 2019 to 2020 in cell R3 and the sheet name will change to January-2020??

Thanks in advance for your help :)
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Put this in the ThisWorkbook module:

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Dim rng As Range

If InStr(Sh.Name, "-") > 0 Then
    Set rng = Intersect(Target, Sh.Range("R3"))
    If Not rng Is Nothing Then
        If Len(rng.Value) > 0 Then
            Sh.Name = Split(Sh.Name, "-")(0) & "-" & rng.Value
        End If
    End If
End If

End Sub
 
Upvote 0
Steve the Fish

Thanks Alot. It works like a charm :) :)

I appreciate your fast response.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,603
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top