Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

consulta sobre formula para una macro

publicado

Estimados;

Junto con saludarlos, les informo que he estado intentando de generar una formula en una macro y me arroja un error, necesito saber si pueden ayudarme.

la formula es: =SI(A2<>A1;G2*I2;SI(Y(A2=A1;G2=0;J2=0);0;SI(Y(A2=A1;G2=0;J2<>0);"";SI(Y(A2=A1;G2<>0;G1=0;J1=0);G2*I2;SI(Y(A2=A1;G2<>0;G1=0;J1<>0);(J1*K1)+(G2*I2);SI(Y(A2=A1;G2<>0;G1<>0);(L1+(G2*I2));"ERROR"))))))

donde como aun no se programar muy bien la genero mediante la opcion de grabar macro y me arroja este codigo:

Range("L2").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-11]<>R[-1]C[-11],RC[-5]*RC[-3],IF(AND(RC[-11]=R[-1]C[-11],RC[-5]=0,RC[-2]=0),0,IF(AND(RC[-11]=R[-1]C[-11],RC[-5]=0,RC[-2]<>0),"""",IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5]=0,R[-1]C[-2]=0),RC[-5]*RC[-3],IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5]=0,R[-1]C[-2]<>0),(R[-1]C[-2]*R[-1]C[-1])+(RC[-5]*RC[-3]),IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5" & _

"[-1]C+(RC[-5]*RC[-3])),""ERROR""))))))"

Range("L3").Select

y no me funciona ya que al ejecutarlo me arroja un error y me lo coloca todo en amarillo el codigo.

Por favor le agradecería que me ayudaran

Featured Replies

publicado

Hola evilbadblack, sería bueno que adjuntes un ejemplo a tu consulta (...Normas del Foro), para tener una idea más clara sobre lo que requieres, ya que así no es muy entendible.

publicado

Hola:

Creo que faltaba un trozo de la fórmula:

Range("L2").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-11]<>R[-1]C[-11],RC[-5]*RC[-3],IF(AND(RC[-11]=R[-1]C[-11],RC[-5]=0,RC[-2]=0),0," & _

"IF(AND(RC[-11]=R[-1]C[-11],RC[-5]=0,RC[-2]<>0),""""," & _

"IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5]=0,R[-1]C[-2]=0),RC[-5]*RC[-3]," & _

"IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5]=0,R[-1]C[-2]<>0),(R[-1]C[-2]*R[-1]C[-1])+(RC[-5]*RC[-3])," & _

"IF(AND(RC[-11]=R[-1]C[-11],RC[-5]<>0,R[-1]C[-5]=0,R[-1]C+(RC[-5]*RC[-3])),""ERROR""))))))"

Range("L3").Select

Saludos

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.