LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default creating a range by searching another worksheet

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SEARCHING RANGE Mickey Mouse[_3_] Excel Discussion (Misc queries) 4 April 12th 08 05:19 AM
searching a range for a sum... chickenshed_bob Excel Worksheet Functions 4 March 30th 06 08:49 PM
3d range searching thephoenix12 Excel Discussion (Misc queries) 0 June 15th 05 06:18 PM
Searching a list with repeat entries and creating a sum Brian Connolly Excel Discussion (Misc queries) 1 February 3rd 05 09:41 PM
searching a range Rich Cooper Excel Programming 1 May 21st 04 04:36 PM


All times are GMT +1. The time now is 04:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"