PDA

View Full Version : Solved: worksheets function



chungtinhlak
01-08-2009, 07:35 AM
how come I keep on getting missmatch type error for this


Sub test()
Dim usecell As Long
usecell = 65536 - Application.WorksheetFunction.CountBlank("A:A")
Range("A1").Value = usecell
End Sub


I get the miss match type for the Countblank("A:A")

I also went in to the immediate window and the below and get the same result, what am i doing wrong?


Application.WorksheetFunction.CountBlank("A:A")


Thanks

Bob Phillips
01-08-2009, 07:43 AM
Public Sub test()
Dim usecell As Long
usecell = Rows.Count - Application.WorksheetFunction.CountBlank(Range("A:A"))
Range("A1").Value = usecell
End Sub

chungtinhlak
01-08-2009, 07:45 AM
thanks. :) feel kind of dumb now. :)