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.

Ayuda Logica Cuadrado números 5X5

publicado

Hola a todos, espero no molestarlos con esto, estoy practicando un poco con los bucles, quiero realizar un cuadrado de números del 1 al 16 que se distribuyan de la siguiente forma:

  1.  En la 1ra Fila: 1 al 5
  2.  En la Columna 5 Fila 2: 6 al
  3.  En la Fila 5 Columna 4:  10 al 13
  4.  En la Columna 1 Fila 4: 14 al 16 

Lo he logrado hacer pero con abundate codigo y no quedo como conforme, favor su gran ayuda si se puede optimizarlo un poco  y darme un feedback para ir mejorando. De antemano muchas gracias, Dios los bendiga.

Ayuda.xlsm

Featured Replies

publicado
Sub Cuadrado()
For x = 1 To 5:   Cells(1, x) = x:      Next
For x = 6 To 9:   Cells(x - 4, 5) = x:  Next
For x = 10 To 13: Cells(5, 14 - x) = x: Next
For x = 14 To 16: Cells(18 - x, 1) = x: Next
End Sub

 

publicado

Otra forma:

Sub Cuadrado()
For x = 1 To 16
   Select Case x
      Case Is < 6:  Cells(1, x) = x
      Case Is < 10: Cells(x - 4, 5) = x
      Case Is < 14: Cells(5, 14 - x) = x
      Case Else:    Cells(18 - x, 1) = x
   End Select
Next
End Sub

 

publicado
  • Autor

Excelente, gracias por la explicación. 

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.