Selección rango variable

G

Guest

Guest
He estado intentando por muchas formas el tratar de seleccionar un rango de celdas que varia según otros criterios, sin embargo, cada vez que corro la macro me marca un error que dice:
"Se ha producido el error '1004' en tiempo de ejecución:
Error definido por la aplicacìón o el objeto"
Uno de los códigos que he puesto es este:
Worksheets("Sheets1").Range(Cells(3, 13), Cells(x, 17)).Select
donde x es el valor de la fila final a seleccionar.
Me gustaría por favor me explicara como puedo seleccionar el rango de celdas ya que necesito graficarlas automáticamente.
Muchas gracias
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Aunque no es necesario seleccionar primero las celdas para graficarlas, el error que veo puede ser que la hoja en la que se están seleccionando las celdas no es la hoja activa.
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,543
Latest member
MartinLarkin

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