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.

SUMA DE NUMEROS Y REDUCIRLO A UN SOLO VALOR

publicado

Buen dia:

Tengo la siguiente formula en mi libro =RESIDUO(SUMA(F2:F15)-1;9)+1 pero necesito que 

se ejecute dentro de la macro y no dentro de la celda como se encuentra.

Como seria el codigo...

Atte Gracias

Reducir valor.xlsm

Featured Replies

publicado
Sub AleaIactaEst()
Dim cuant As Integer: cuant = Range("B1")
Dim aleat As Integer
Dim r As Range: Set r = Range("F2:F15")
Dim q, i As Integer
Worksheets(1).Range("F2:H15").ClearContents
'--------------------------------------------------------------------------------------
'Aleatorios
'--------------------------------------------------------------------------------------
q = 0
Do
aleat = Application.WorksheetFunction.RandBetween(Range("B2"), Range("B3"))
q = q + 1: If q > cuant Then Exit Do
    r(q, 1) = aleat
    If q > 1 Then
         For i = 1 To q - 1
            If r(i, 1) = aleat Then
            r(q, 1) = ""
            q = q - 1
                Exit For
            End If
    Next
End If
Loop
'--------------------------------------------------------------------------------------
Range("F2:F15").Sort Key1:=Range("F2:F15"), Order1:=xlAscending
Cells(17, 6) = Application.WorksheetFunction.Sum(ActiveSheet.Range("F2:F15"))
'--------------------------------------------------------------------------------------

Range("F18").Formula = "=MOD(SUM(F2:F15)-1,9)+1"
Range("F18").Value = Range("F18").Value 'Boorar esta linea si quieres que se vea la formula.
Exit Sub
End Sub

Hola, prueba con el código añadido.

publicado
  • Autor

Buen dia César Rolando, el código funciono bien...

Agradecido por tu ayuda.

Gracias....

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.