COUTBLANK関数で空白セル個数を取得

 

Sub test()
 ’  COUTBLANK関数で空白セル個数を取得

 

  Dim myCnt As Long

  If TypeName(Selection) <> "Range" Then Exit Sub


  myCnt = WorksheetFunction.CountBlank(Selection)


  MsgBox Format(myCnt, "#,##0")

 


End Sub

 

 

 

― ― ― ― ― ― ― ― ― ― → Excel VBA基礎入門もくじ へ戻る 

 

参考記事