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.

Loop infinito

publicado

Hola, tengo un problema con un bucle. El caso es que en el Mac me funciona pero en windows no.

El código es este:

Private Sub Worksheet_Calculate()

Dim KeyCells As Range

If Range("C13") = 1 Then

Range("D7").Value = Range("D7").Value - 1

End If

Do While Range("C13") = 1

Range("D7").Value = Range("D7").Value - 1

Loop

If Range("C13") = 0 Then

Range("D7").Value = Range("D7").Value + 1

End If

Do While Range("C13") = 0

Range("D7").Value = Range("D7").Value + 1

Loop

Range("D7").Value = Range("D7").Value - 1

End Sub

El caso es que quiero que cuando una celda (la C13) sea 1, me reste 1 de la celda D7, y así hasta que sea la celda C13 cero.

Una vez leído esto, en caso de ser cero la celda C13, que sume 1 a la D7 hasta que C13 sea 1, y luego le reste 1 a la celda D7.

El problema es que en windows se queda atascado sumando y restando 1, pero en el Mac no. Alguna idea?

Gracias!

Featured Replies

No hay posts para mostrar

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.