Brian,
You need to loop through the areas collections of the filled cells. See the macro below for an
example, which assumes that your filled cells are constants.
HTH,
Bernie
MS Excel MVP
Sub Macro2()
Dim myCell As Range
Dim myArea As Range
Dim myData As Range
Set myData = Cells.SpecialCells(xlCellTypeConstants, 23)
For Each myArea In myData.Areas
MsgBox myArea.Address & " has " & myArea.Cells.Count & " cells."
'Process areas here
For Each myCell In myArea.Cells
'use this inner loop to process through the cells
Next myCell
Next myArea
End Sub
"Brian Matlack" wrote in message
news:Brian.Matlack.1x9hud_1129914323.4604@excelfor um-nospam.com...
Hi!
I don't yet understand loop macros but I'd like to.
I am importing a text file that is a variable number of data groups
that also vary in length (rows). The groups are separated by 2 blank
rows and the data in each group is contiguous.
How can I select these groups and process them when I don't always know
how many there are or how long they are.
Thanks!
--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=478288