Suma en Macro

chebapuc

New Member
Joined
Apr 4, 2006
Messages
18
Hola.
Por favor, alguien que me yude con esto:

Necesito hacer una función suma pero desde una macro donde las celdas estén definidas por variables. He probado con esto:

ActiveCell.FormulaR1C1 = "=SUM(R[str1FILA]C:R[str2FILA]C)"

pero no me funciona. Por favor, alguien que tenga la respesta, muchas gracias.

Sebastián
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Proba con esto


ActiveCell.FormulaR1C1 = "=SUM(R[" & str1FILA &"]C:R["& str2FILA &"]C)"

GALILEOGALI
 
Upvote 0
Hola Galileo,

Gracias por haber estado ayudando aquí. He tenido una semana bastante divertido haciendo justamente un proyecto de Excel. Esta semana he escrito unos 1.900 y pico líneas de VBA más importando unos 1.400 líneas de módulos genéricos ya prehechos que tengo. Pero ya me falta poco - tal vez unos 200-400 líneas más.
<hr/>
Bueno,chebapuc,

Favor note que poniendo los "[" y "]", usted está haciendo una fórmula relativa. Esto sirve bien si usted quire copiarlo a otras celdas. Pero si str1FILA no se hizo en términos relativos a la celda activa, no le va a funciona como espera. Mejor hacer la fórmula con direccionas absolutas o cambiar la forma de hacer str1FILA.

Saludos cordiales,
 
Upvote 0

Forum statistics

Threads
1,226,693
Messages
6,192,463
Members
453,725
Latest member
cvsdatreas

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