0
I have a sub in VBA that does several calculations to get into a range address list listaAddresses = "$A$1, $H$3,$V$1,$M$16,$A$21,$B$13,$H$88..... $T$44"
With this list I need to select all ranges. So I tried - Range(listAddresses). Select
However, when I have more than a certain number of Ranges, VBA and VB (tried in both), give error and do not select any cells.
Hello colleague. I could not reproduce the problem you say you have. In a quick test set the variable
listaAddresses = "$A$1,$H$3,$V$1,$M$16,$A$21,$B$13,$H$88,$T$44"
and then called the selection makingRange(listaAddresses).Select
. It worked, as you can see in this screenshot: http://imgur.com/a/CYWmw Edit the question to explain better or make a [mcve] that reproduces the problem.– Luiz Vieira
I just got it. I looped the Addresses lists and used Union to concatenate all the Addresses
– Copito
The problem happens after 255 separate ranges. I think it must be some string limit.
– Copito
Well, okay. Maybe there’s some limit even on the number of intervals you can pass to the method
Select
(despite of documentation do not specify anything). You should have made it clear that this was the problem in the question. I suggest editing the question to put this information (that an error occurs - by the way, indicate which error occurred - when there are more than 255 separate intervals). Then I also suggest that you create an answer with your solution (the idea of Union is very good! ). If you do this, you get my +1 question and answer. :)– Luiz Vieira