Rangos de Seleccion MULTIPLE

galileogali

Well-known Member
Joined
Oct 14, 2005
Messages
748
Vengo probando y obteniendo resultados muy distintos a los esperados CODIGO como el siguiente:


Code:
Sub valorizar()
Range("A1:A9,C11:C19,E8:E15") = Range("A1:A9,C11:C19,E8:E15").Value
End Sub

¿Algún comentario?
 
Vamos a decir que el rango MyRange tiene:

<table border="1" bordercolor="#C0C0C0" bordercolordark="#FFFFFF" cellspacing="0" > <tr valign="top"> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>a</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>1</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>10</nobr></font></td> </tr> <tr valign="top"> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>b</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>2</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>20</nobr></font></td> </tr> <tr valign="top"> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>c</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>3</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>30</nobr></font></td> </tr> <tr valign="top"> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>d</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>4</nobr></font></td> <td width="63" height="21" align="center" valign="bottom"><font face="Monospace" size="1"><nobr>40</nobr></font></td> </tr></table>

Usando la forma sencilla de Index() faltando un argumento se puede sacar algo para una sola column:<ul>[*]Sacando columna 2<ul>[*]=SUM(INDEX(MyRange,,2)) = 10[*]=AVERAGE(INDEX(MyRange,,2)) = 2.5[/list][*]Usando columns 3<ul>[*]=SUM(INDEX(MyRange,,3))= 100[*]=AVERAGE(INDEX(MyRange,,3))= 25[/list][/list]Pero usando OFFSET se puede sacar dos columns (contiguas)
<ul>[*]=SUM(OFFSET(INDEX(MyRange,,2),0,0,,2))= 110[*]=AVERAGE(OFFSET(INDEX(MyRange,,2),0,0,,2))= 13.75[/list]
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,223,966
Messages
6,175,661
Members
452,666
Latest member
AllexDee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top