Could you tell me how to use VBA in Excel E1 batch operation makes the cell's name is the name of the sheet? How to write code? Small white consult !!!!! Thank you thank you!
CodePudding user response:
Sub Macro1 () For Each Sheet Sheets In If the Trim (Sheet. Cells (5, 1). The Text & lt;> "") Then Sheet. Name=Sheet. The Cells (5, 1). The Text End the If Next End Sub
CodePudding user response:
Trim the sentence the position of the bracket is a bit wrong, use the following
Sub Macro1 () For Each Sheet Sheets In If the Trim (Sheet. Cells (5, 1). The Text) & lt;> "" Then Sheet. Name=Trim (Sheet. Cells (5, 1). The Text) End the If Next End Sub