如果是判断单个,用Range太浪费了 if ThisWorkbook.Sheets(1).Cells(1,1).Value2 = "" then 'do something End If
Cells()方法?没有呀?
呵呵,我用的是EXCEL中VBA的語法... ...
VBA: if ThisWorkbook.Sheets(1).Cells(1,1).Value2 = "" then 'do something End If Excel內置函數: =if(and(len(A1)>0,len(B1)>0),A1-B1,0) (若A1、B1單元格內容都不為空,則值為A1-B1,否則為0)
if(ran.Value2==null)
{}
Excel.Range 类
单个对象
有时表示一个对象集合
if ThisWorkbook.Sheets(1).Cells(1,1).Value2 = "" then
'do something
End If
Cells()方法?没有呀?
if ThisWorkbook.Sheets(1).Cells(1,1).Value2 = "" then
'do something
End If
Excel內置函數:
=if(and(len(A1)>0,len(B1)>0),A1-B1,0)
(若A1、B1單元格內容都不為空,則值為A1-B1,否則為0)