Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code that loops through the records and does fine but I
cannot get it to loop back through all of the records in column A. It looks at cell A1 and does the loop and stops. What am I doing wrong? Option Base 1 Public RelOpts() As String Sub GetRelOpt() x = 1 NextRow = 0 StrToMatch = Cells(1 + NextRow, 1).Value ReDim RelOpts(1 To x) Do While Cells(1 + NextRow, 1).Value < "" If Cells(1 + NextRow, 1).Value = StrToMatch Then RelOpts(x) = Cells(1 + NextRow, 2).Value x = x + 1 ReDim Preserve RelOpts(x) As String End If NextRow = NextRow + 1 Loop y = 1 Do Until RelOpts(y) = "" CCString = CCString + RelOpts(y) + " ," y = y + 1 Loop Cells(1, 5).Value = Left(CCString, (Len(CCString) - 2)) End Sub Deb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete records when certain records have duplicate column data | New Users to Excel | |||
draw 999 x 8 random records from file with 8614 records | Excel Programming | |||
Delete two records together with looping | Excel Programming | |||
urgent. looping thru all records and applynig formula to get new results | Excel Programming | |||
Looping Through Records. | Excel Programming |