Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I've replied to you via private email -- Regards Frank Kabel Frankfurt, Germany "Rich Cooper" schrieb im Newsbeitrag ... Hey frank i am still haveing trouble with that array this is what i got so far Dim LastRow As Integer Dim FirstRow As Integer Dim rowndx As Integer Sub findrows() 'Dim LastRow As Integer 'Dim FirstRow As Integer Dim i As Integer Dim x As Integer Dim a As Integer Dim b As Integer Dim mearray() As String ReDim mearray(10) LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row i = 1 x = 1 For rowndx = 1 To LastRow If Left(Cells(rowndx, "A").Value, 1) = "M" And Mid(Cells(rowndx, "A").Value, 2, 1) = x Then FirstRow = rowndx mearray(a) = Left(Cells(rowndx, "A").Value, 2) Exit For x = x + 1 End If Next rowndx "Frank Kabel" wrote in message ... Hi try: Sub test_rng() Dim ar_values As Variant Dim RowNdx As Long Dim LastRow As Long Dim FirstRow As Long Dim i LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row ReDim ar_values(1 To LastRow) i = 0 For RowNdx = 1 To LastRow With Cells(RowNdx, "A") If Left(.Value, 2) = "M1" Then FirstRow = RowNnx Exit For End If End With Next For RowNdx = FirstRow To LastRow With Cells(RowNdx, "A") If Left(.Value, 1) = "M" And _ --Mid(.Value, 2, 1) i Then i = i + 1 ar_values(i) = Left(.Value, 2) End If End With Next RowNdx End Sub -- Regards Frank Kabel Frankfurt, Germany "Rich Cooper" schrieb im Newsbeitrag ... Sorry about that here is what the data looks like then. I didn't know about attaching the file. I am sorry. MNTH1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SEARCHING RANGE | Excel Discussion (Misc queries) | |||
searching a range for a sum... | Excel Worksheet Functions | |||
3d range searching | Excel Discussion (Misc queries) | |||
Searching a list with repeat entries and creating a sum | Excel Discussion (Misc queries) | |||
searching a range | Excel Programming |