2016-06-08 68 views
0

我有數據有空和不同的值。我想要寫一個檢查行的公式,如果行的所有值均爲NULL應該給結果1否則爲0。誰能幫助編寫公式如何編寫excel公式檢查行並返回一個值?

+0

'= 1 *(COUNTA(A1:Z1)= 0)' –

+0

僅當單元格爲真時爲空,且不爲單元格中的公式結果時,上述操作纔有效。如果單元格有公式,那麼將需要一個不同的公式。 –

回答

0
Dim neValues As Range, neFormulas As Range 

On Error Resume Next 
Set neValues = ActiveCell.EntireRow.SpecialCells(xlConstants) 
Set neFormulas = ActiveCell.EntireRow.SpecialCells(xlFormulas) 
On Error Goto 0 

If neValues Is Nothing And neFormulas Is NothingApplication.CountA(ActiveCell.EntireRow)=0 Then 
    MsgBox "Nothing There" 
Else 
    MsgBox "Something's There" 
End If 

檢查http://www.ozgrid.com/forum/showthread.php?t=26509瞭解更多詳情。

0

你沒有給我們很多細節,但我認爲COUNTBLANKS(範圍)公式應該是你所需要的。

EDIT 在烏爾特定杜鬆我想嘗試: = IF(CountBlanks(範圍)=列(範圍),0,1)

相關問題