判断方法是:if typeName(curRange)"Nothing" then...end if下面是几个例子:例1:If Cells(1,1).value"" then '如果A1不为空,第一个工作薄的名称是A1单元格的值
SHEETS(1).name=cells(1,1).valueend if也可以加一个循环,直到找到A列不为空的单元格例2:dim x as rangefor each x in range("A1:A65536")
if x.value"" then
sheets(1).name=x.value
exit for
end ifnext