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.

¿Que quito?

publicado

Hola EXCELENTES.

Heredé este código. Yo no tengo NI IDEA de programación.

 

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo errorfecha

If Not Intersect(Target, Range("A1830")) Is Nothing Then

    If Range("A1830").Value <> "" Then

            If Application.WorksheetFunction.Weekday(Range("A1830").Value, 2) >= 6 Then

                On Error GoTo 0

                MsgBox "No puede ser sábado o domingo", vbCritical

                Range("A1830").EntireRow.Delete

                Range("A1830").Select

 

            ElseIf (Range("A1830").Value < Date - 7 Or Range("A1830").Value > Date + 3) Then

                MsgBox "No puede superar los siete días", vbCritical

                Range("A1830").EntireRow.Delete

                Range("A1830").Select

 

            Else

                If Not Intersect(Target, Rows("1830:1830")) Is Nothing Then

                    Rows("3:3").EntireRow.Delete

                    Target.Offset(0, 1).Select

                   

                End If

            End If

    End If

End If

Exit Sub

errorfecha:

Range("A1830").ClearContents

End Sub

 

¿Pero que quito para que no proteste por los Sábados y Domingos?.

Muchas gracias y SALU2.

Featured Replies

publicado

Prueba así:

Private Sub Worksheet_Change(ByVal Target As Range): On Error GoTo ErrorFecha
'-------------------------------------------------------
If Not Intersect(Target, Range("A1830")) Is Nothing Then
   If IsDate(Range("A1830")) Then
      If Range("A1830") < Date - 7 Or Range("A1830") > Date + 3 Then
         MsgBox "No puede superar los siete días", vbCritical
         Rows(1830).Delete
         Range("A1830").Select
      Else
         If Not Intersect(Target, Rows(1830)) Is Nothing Then
            Rows(3).EntireRow.Delete
            Target.Offset(0, 1).Select
         End If
      End If
   End If
End If
Exit Sub
'-------------------------------------------
ErrorFecha:
Range("A1830").ClearContents
End Sub

 

Editado el por Antoni

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.