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.

Números aleatorios sin repetición

publicado

Hola :

Encontré esta macro en internet que funciona bien pero deseo modificarla para que no me repita los números cada 6 celdas. Alguien me puede ayudar ? Gracias

Sub Saca10alAzar()

x = 6

Randomize

For i = 5 To 43

Range("B" + Trim(Str(i))).Value = Int((x * Rnd()) + 1)

Next

End Sub

Featured Replies

publicado

Hola, intenta así:

Sub Saca10alAzar()
x = 43
Randomize
For i = 5 To 43
o:
num = Int((x * Rnd()) + 1)
If Application.CountIf(Columns("B"), num) >= 1 Then GoTo o
Range("B" & i) = num
Next
End Sub
[/PHP]

Salu2

publicado

[uSER=204513]@GustavoH[/uSER]

Sube ejemplo en una hoja Excel

Saludos

publicado
  • Autor

Gracias Riddle :

La idea es que no se repitan pero cada determinado número de celdas; en el ejemplo que subí, cada 6 celdas.

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.