joeyc
07-03-2008, 07:13 PM
Hi guys,
This thread was originally solved by members of this forum. Here is the link if it helps: http://www.vbaexpress.com/forum/showthread.php?t=20109
Let me explain what this thing does. I have data in A, B, and C. These are financial products. For each product in each database, I would like to add up the Market Cap Percentage for the desired range. Now currently, this works but it only works when more than 1 product is listed. So, I can only perform this task when I have two or more products. On many occasions, I have only one product. How can the macro be modified so that it will work on one product as well as up to 25?
Sub FillRanges()
Columns("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"IV1"), Unique:=True
Range(Cells(2, "IV"), Cells(2, "IV").End(xlDown)).Copy
Range("H17").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range(Cells(1, "IV"), Cells(1, "IV").End(xlDown)).ClearContents
End Sub
This thread was originally solved by members of this forum. Here is the link if it helps: http://www.vbaexpress.com/forum/showthread.php?t=20109
Let me explain what this thing does. I have data in A, B, and C. These are financial products. For each product in each database, I would like to add up the Market Cap Percentage for the desired range. Now currently, this works but it only works when more than 1 product is listed. So, I can only perform this task when I have two or more products. On many occasions, I have only one product. How can the macro be modified so that it will work on one product as well as up to 25?
Sub FillRanges()
Columns("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"IV1"), Unique:=True
Range(Cells(2, "IV"), Cells(2, "IV").End(xlDown)).Copy
Range("H17").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range(Cells(1, "IV"), Cells(1, "IV").End(xlDown)).ClearContents
End Sub