我试图在按下按钮后创建一个以值为范围的新工作表,但出现以下错误:“对象_工作表的方法'范围失败“当我设置MyRange基于范围创建工作表(忽略空单元格)
我现在的表是‘V级气相色谱法’和起动电池是U2 这里是我到目前为止有:
Dim MyCell As Range, MyRange As Range
Set MyRange = Range(Sheets("V-Class GC").[u2], Sheets("V-Class GC").Cells(Rows.Count, "U").End(xlUp))
For Each MyCell In MyRange
If Len(MyCell.Text) > 0 Then
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = MyCell.Value
End If
Next MyCell
谢谢!
什么是单元格U2? – SJR