Maybe a UDF like this:
Option Explicit
Function CountCells(str As String) As Variant
Dim testRng As Range
Set testRng = Nothing
On Error Resume Next
Set testRng = Application.Caller.Parent _
.Range(Application.Substitute(str, "-", ":"))
On Error GoTo 0
If testRng Is Nothing Then
CountCells = CVErr(xlErrRef) 'or just 0??
Else
CountCells = testRng.Cells.Count
End If
End Function
===
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Short course:
Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)
right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side
Paste the code in there.
Now go back to excel.
Into a test cell and type:
=countcells(A1)