Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给你的专家一个简单的问题。
试图弄清楚如何让单元格 A1 = sheetname.
我尝试了以下但得到了编译错误
y = Sheetname() Range(A1) = y
ActiveSheet.Range("A1") = ActiveSheet.Name
如果您希望每张纸都使用它,那么
Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Range("A1") = ws.Name Next