投稿日 | : 2006/04/26(Wed) 22:22 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re: Excelのワークシート関数COUNTIFの使用方法 |
CountIf 関数の使い方なら イルカ に聞けば教えてくれますよ。
Private Sub Command1_Click()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("C:\Temp.xls")
Set xlSheet = xlBook.Worksheets(1)
xlApp.Visible = True
Dim CNT As Long
CNT = xlApp.WorksheetFunction.CountIf(xlSheet.Range("B1:F1"), "×")
Debug.Print CNT
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
End Sub