在Excel中,如何将电子表格名称从小写更改为大写

在Excel中使用VBA 有办法将工作表的标签名称从小写更改为大写?

我有一个超过50张工作簿,单独更改名称似乎不是一个非常有吸引力的选项。

电子表格名称已在单元格A1中,并已大写 。 只需要实际的工作表名称大写。

就像是:

for each ws in Workbooks("").worksheets ws.name = ucase(ws.name) 'or ws.name = ucase(ws.range("A1")) next 

干得好 :

 Sub Lower2UpperCase() Dim wB As Workbook, _ wS As Worksheet Set wB = ActiveWorkbook For Each wS In wB.Worksheets 'Only thing needed if ALL of your sheets'name are in A1 in Upper case : wS.Name = wS.Range("A1") 'If all the sheets'name are in A1 but not all in Upper case : 'wS.Name = UCase(wS.Range("A1")) 'Take the name of the sheet and change the case to all Upper case : 'wS.Name = UCase(wS.Name) Next wS End Sub