Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, is there a way to do the same thing that is doing this code, but in more general way because this is taking the 64K availables in th macro Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp)) Info = "" For Each i In RngColD If i.Value = Range("A493").Value Then If Info = "" Then Info = i.Offset(, 20).Value Else Info = Info & "," & i.Offset(, 20).Value End If End If Next i Range("S493") = Info Info = "" Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp)) Info = "" For Each i In RngColD If i.Value = Range("A494").Value Then If Info = "" Then Info = i.Offset(, 20).Value Else Info = Info & "," & i.Offset(, 20).Value End If End If Next i Range("S494") = Info Info = "" Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp)) Info = "" For Each i In RngColD If i.Value = Range("A495").Value Then If Info = "" Then Info = i.Offset(, 20).Value Else Info = Info & "," & i.Offset(, 20).Value End If End If Next i Range("S495") = Info Info = "" Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp)) Info = "" For Each i In RngColD If i.Value = Range("A496").Value Then If Info = "" Then Info = i.Offset(, 20).Value Else Info = Info & "," & i.Offset(, 20).Value End If End If Next i Range("S496") = Info Info = "" Set RngColD = Range("D2", Range("D" & Rows.Count).End(xlUp)) Info = "" For Each i In RngColD If i.Value = Range("A497").Value Then If Info = "" Then Info = i.Offset(, 20).Value Else Info = Info & "," & i.Offset(, 20).Value End If End If Next i Range("S497") = Info Info = " -- John2 ----------------------------------------------------------------------- John21's Profile: http://www.excelforum.com/member.php...fo&userid=3698 View this thread: http://www.excelforum.com/showthread.php?threadid=57143 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo | Excel Discussion (Misc queries) | |||
Long Long Long Nested If Function | Excel Discussion (Misc queries) | |||
HELP - Too long coding for Macro | Excel Worksheet Functions | |||
How to solve too long coding for Macro ? | Excel Worksheet Functions | |||
how do i add time to see how long my macro takes to run | Excel Programming |