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.

Aplicar fórmula a celda mediante BVA

publicado

Hola buen día.

Tengo aquí un detalle para agregar una formula a una celda de excel mediante VBA.

Agrego la formula

 Sub Botón16_Haga_clic_en()
For i = 26 To 2381 If Sheets("Pin(mm)").Cells(i, C) = Sheets("Pin(mm)").Cells(11, AU) Or Sheets("Pin(mm)").Cells(i, C) = Sheets("Pin(mm)").Cells(14, AU) Or Sheets("Pin(mm)").Cells(i, C) = Sheets("Pin(mm)").Cells(18, AU) Then
||||||||sheets("Pin(mm)").cells(i,C)
End Sub

[/CODE]

Ya tengo el for que me indica que celdas comparar para que en otra celda le iinserte la formula, entonces pongo un if para guardar algunos datos que necesito, despues del then viene el detalle, tenia pensando en poner algo asi

[CODE]sheets("Pin(mm)").cells(i,C) = "=La formula que necesito pero ocupo usar la variable "i" aqui es donde creo que me mostrara un error" [/CODE]

ejemplo si quisiera utsar la celda c11 cuando el for tenga la variable i en 11, no se si pueda ponerle ci (Donde i es variable y significa que estara en 11), esa es mi duda si lo hara o no. Espero puedan ayudarme.

Gracias y saludos.

Featured Replies

publicado

A ver si lo he entendido:

Sub Botón16_Haga_clic_en()

For i = 26 To 2381
If Sheets("Pin(mm)").Cells(i, [B]"[/B]C[B]"[/B]) = Sheets("Pin(mm)").Cells(11, [B]"[/B]AU[B]"[/B]) Or _
Sheets("Pin(mm)").Cells(i, [B]"[/B]C[B]"[/B]) = Sheets("Pin(mm)").Cells(14, [B]"[/B]AU[B]"[/B]) Or _
Sheets("Pin(mm)").Cells(i, [B]"[/B]C[B]"[/B]) = Sheets("Pin(mm)").Cells(18, [B]"[/B]AU[B]"[/B]) Then
Sheets("Pin(mm)").Cells(i, [B]"[/B]C[B]"[/B]).[B]FormulaLocal[/B] = "=Aquí tu fórmula"
End If
Next

End Sub


[/CODE]

Observa que la columna va entre comillas.

publicado
  • Autor

Excelente gracias por contestar.

Solo que el detalle es por ejemplo que mi formula real sea "=A26 + 12." entonces yo quiero que mi variable "i" aparesca en vez de 26(Cuando el for valla en 26 y como cambia obviamente cambiara la formula es lo que quisiera). algo asi "=Ai + 12" es posible hacer esto?

otra vez gracias y estamos en contacto.

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.