The program have the same problem

J

John21

This code:

dim RngColD as Range, Info as Variant, Info1 as Variant
Dim s as String
s = ""
Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp))
Info = RngColD.Value
Info1 = RngColD.Offset(0,10).Value
For i = 1 to Ubound(info,1)
If info(i,1) = Range("A493").Value Then
If s = "" Then
s = Info1(i)
Else
s = s & "," & Info1(i)
End If
End If
Next i
Range("I493").Value = s
s = ""

..............is giving the same error as before in the declaration o
"s"
[s = Info1(i)] "Subscript out of range
 
D

Dave Peterson

You used two dimensions when you referred to info.

If info(i,1) = Range("A493").Value Then

How about trying two dimensions when you refer to info1?


This code:

dim RngColD as Range, Info as Variant, Info1 as Variant
Dim s as String
s = ""
Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp))
Info = RngColD.Value
Info1 = RngColD.Offset(0,10).Value
For i = 1 to Ubound(info,1)
If info(i,1) = Range("A493").Value Then
If s = "" Then
s = Info1(i)
Else
s = s & "," & Info1(i)
End If
End If
Next i
Range("I493").Value = s
s = ""

.............is giving the same error as before in the declaration of
"s"
[s = Info1(i)] "Subscript out of range"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top