Barry has attended:
Excel VBA Intro Intermediate course
Spaces in data source
Hi Guys
Wonder if you can help me.
I have a range of data with phone records which need to be counted by service number then data filled into another sheet.
This sheet has a list of numbers down the left hand side which some are broken up by blank rows.
I need the macro to jump over these blank rows and continue to search through the service numbers until there are no more.
The problem i have is i cant use range due to these spaces and can't remove the spaces.
Any help would be greatful.
Cheers
RE: Spaces in data source
Hi Barry, thanks for your query. Here's some rather rough code to count items in a range, skipping blank rows:
-----------------------------
Sub test()
Dim introwcount As Long
Dim mycounter As Integer
mycounter = 0
For introwcount = 1 To 65000
If Cells(introwcount, 1).Value <> "" Then
mycounter = mycounter + 1
End If
Next introwcount
MsgBox mycounter
End Sub
-----------------------------
Hope this helps,
Anthony