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.

ejecutar 2 macros la cantidad de veces que sea posible

publicado

tengo los siguientes codigos y me gustaria tener la opcion de ejecutarlos la cantidad de veces que sea necesario 

por ejemplo 

call aleato

call zero

ejecutar la siguiente cantidad de veces (  ) 

Sub Aleato()
borrar_anteriores
With Application
   .ScreenUpdating = False
   .DisplayAlerts = False
   '--
   ufila99 = 1 + Hoja99.Cells(Rows.Count, 1).End(xlUp).Row
   tf = Sheets("estadisticas").UsedRange.Rows.Count
   tc = Sheets("estadisticas").UsedRange.Columns.Count
   '--
   For x = 6 To 37
      Do: f = Int((tf * Rnd) + 1)
          c = Int((tc * Rnd) + 1)
      Loop Until Sheets("estadisticas").Cells(f, c) <> ""
      Sheets("analisis").Range("B" & x) = CDbl(Sheets("estadisticas").Cells(f, c))
      Sheets("analisis").Range("B" & x).NumberFormat = "0000"
      Sheets("estadisticas").Cells(f, c).Interior.Color = vbYellow
      Hoja99.Cells(ufila99, 1).Value = f
      Hoja99.Cells(ufila99, 2).Value = c
      ufila99 = ufila99 + 1
   Next
   '--
   .ScreenUpdating = True
   .DisplayAlerts = True
End With
End Sub

Sub zero()

Dim ultimaCeldaDatos As String

'hallar la ultima celda con datos de la columna B de la hoja estadistica
ultimaCeldaDatos = Sheets("analisis").Cells(Rows.Count, 2).End(xlUp).Row
'copiando datos de columna B
Sheets("analisis").Range("b5:b" & ultimaCeldaDatos).Copy

Sheets("archivo").Select
'posicionando en la celda donde pegare los datos en la hoja archivo
Sheets("archivo").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 2).Select
Selection.PasteSpecial
Application.CutCopyMode = False

'copiando datos de las columnas de Estadísticas Descriptivas de la hoja estadistica
Sheets("analisis").Range("q7:r19").Copy
Sheets("archivo").Select
'posicionando en la celda donde pegare los datos en la hoja archivo
Sheets("archivo").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 2).Select
Selection.PasteSpecial xlPasteValues

'configurando el borde y tamaño de las columnas de Estadísticas Descriptivas
Selection.Borders.Weight = XlBorderWeight.xlThin
Selection.ColumnWidth = 20
Application.CutCopyMode = False

End Sub

 

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.