Hello all,
I am working with an Excel sheet that I am using to dump information into several public workbooks on a network. The information is placed into those workbooks in sheets that are by month (one sheet per month). I have code written to make sure the right sheet is selected based on the current date and that brings me to my problem. I need to dump this info into 4 different workbooks with the sheet named Dec, but each workbook may have the sheet named dec, decem, december, Decem, or December depending on who created or uses this workbook. How can I have VBA code look for the different name options and rename it to “Dec”
I am currently trying:
Sub Test2()
Dim sh As Worksheet, flg As Boolean
For Each sh In Worksheets
If sh.Name Like "apr*" Then
Sheets("apr").Name = "April"
Else
If sh.Name Like "Apr*" Then
'If flg = True Then
Sheets("Apr").Name = "April"
and so on for each possible name and month
Thanks for the help.
Tnt6869
I am working with an Excel sheet that I am using to dump information into several public workbooks on a network. The information is placed into those workbooks in sheets that are by month (one sheet per month). I have code written to make sure the right sheet is selected based on the current date and that brings me to my problem. I need to dump this info into 4 different workbooks with the sheet named Dec, but each workbook may have the sheet named dec, decem, december, Decem, or December depending on who created or uses this workbook. How can I have VBA code look for the different name options and rename it to “Dec”
I am currently trying:
Sub Test2()
Dim sh As Worksheet, flg As Boolean
For Each sh In Worksheets
If sh.Name Like "apr*" Then
Sheets("apr").Name = "April"
Else
If sh.Name Like "Apr*" Then
'If flg = True Then
Sheets("Apr").Name = "April"
and so on for each possible name and month
Thanks for the help.
Tnt6869