Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The below macro is bombing 5 rows from (the present) bottom.
I'm sure it is elementary, but obviously not for me. Can someone point out my problem? Thanks in Advance.. Jim Sub Foo() Dim searchc As String Dim DestWb As Workbook Dim MyList As Range Dim Arr() As Long Dim i As Integer Range("B2").Select searchc = ActiveCell.Offset(0, -1).Value Set DestWb = Workbooks("Ex1.xls") Workbooks("Ex2.xls").Activate Lrow = Cells(Rows.Count, "b").End(xlUp).Row Set MyList = Range("B2:B" & Lrow) Range("B2").Select i = 0 For Each c In MyList If c.Offset(0, -1) = searchc Then i = i + 1 Arr(i) = c.Value '' R/T Error 9, Subscript Out of range c.Offset(1, 0).Select End If Next c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Gap or something I cannot understand | Excel Discussion (Misc queries) | |||
not understand | New Users to Excel | |||
I don't Understand | Excel Worksheet Functions | |||
Help me understand this code | Excel Discussion (Misc queries) | |||
< |
Excel Worksheet Functions |