Hi - need som help, I'm trying to calculate the number of cells that are blank between two fields.

The code below does the following:

1. strLBLSearch = General

2. lngFirst = 1

Trying to figure our how to get A5 cell value.

A1 = General

A2 =

A3 =

A4 =

A5 = Commercial

A6 = Electrical

A7 =

A8 = Business

I know that I can use the following to calculate the number of blank cells within a range:

strRange = "A" & lngFirst & ":" & "A" & lngSecond

intNumberMissing = WorksheetFunction.CountBlank(Range(strRange))

'------------------------------------------------------------------

Dim lngFirst, lngSecond As Long

For r = 1 To strCells

x = ws.Cells(r, 1)

y = ws.Cells(r, 2)

w = ws.Cells(r, 3)

If strLBLSearch = x Then

lngFirst = r

End If

Next r

'--------------------------------------------------------------

Sub CountBlanks()

Dim FirstCell As Range, NextNonBlank As Range

Set FirstCell = Range("A1")

Set NextNonBlank = FirstCell.End(xlDown)

MsgBox "There are " & NextNonBlank.Row - FirstCell.Row - 1 & " blanks"

End Sub

Cheers

Dave