ForumExcel
New Member
- Joined
- Jan 17, 2017
- Messages
- 21
Second sub invokes the first. I am getting Error 424 Object required error! Could you please help me with why?
The first sub works fine if I uncomment the commented line and comment the following one
The first sub works fine if I uncomment the commented line and comment the following one
Code:
Sub ShowRangeValues(myRange As Range)
Dim rng As Range
Dim cll As Range, i As Integer, a(100) As Variant
' Set rng = Range(Range("A2:B2"), Range("A2:B2").End(xlDown)).SpecialCells(xlCellTypeVisible)
Set rng = myRange
i = 0
For Each cll In rng
a(i) = cll.Value
Debug.Print a(i)
i = i + 1
Next
Debug.Print "Done"
End Sub
Sub TestShowRangeValues()
Dim rng As Range
Set rng = Range(Range("A2:B2"), Range("A2:B2").End(xlDown)).SpecialCells(xlCellTypeVisible)
ShowRangeValues (rng)
End Sub