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.

Calcular edad con fecha de nacimiento - exacto

publicado

Private Sub TextBox10_Change()

Application.ScreenUpdating = False

On Error Resume Next

Dim cam As Integer

cam = Len(TextBox10.Text)

Select Case cam

Case 2

Me.TextBox10.Text = Me.TextBox10 & "/"

Case 5

Me.TextBox10.Text = Me.TextBox10 & "/"

End Select

Dim fecactual As Date

Dim fecnac As Date

Dim edadactual As String

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("d", fecnac, Now)

TextBox11.Text = edadactual

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("m", fecnac, Now)

TextBox12.Text = edadactual

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("yyyy", fecnac, Now)

TextBox13.Text = edadactual - 1

Application.ScreenUpdating = True

If TextBox11.Text <> Empty Then

TextBox11.Enabled = False

TextBox12.Enabled = False

TextBox13.Enabled = False

Else

TextBox11.Enabled = True

End If

End Sub

Featured Replies

publicado
Private Sub TextBox10_Change()

Application.ScreenUpdating = False

On Error Resume Next

Dim cam As Integer

cam = Len(TextBox10.Text)

Select Case cam

Case 2

Me.TextBox10.Text = Me.TextBox10 & "/"

Case 5

Me.TextBox10.Text = Me.TextBox10 & "/"

End Select

Dim fecactual As Date

Dim fecnac As Date

Dim edadactual As String

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("d", fecnac, Now)

TextBox11.Text = edadactual

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("m", fecnac, Now)

TextBox12.Text = edadactual

fecnac = CDate(TextBox10.Value)

edadactual = DateDiff("yyyy", fecnac, Now)

TextBox13.Text = edadactual - 1

Application.ScreenUpdating = True

If TextBox11.Text <> Empty Then

TextBox11.Enabled = False

TextBox12.Enabled = False

TextBox13.Enabled = False

Else

TextBox11.Enabled = True

End If

End Sub

Hola y se bienvenido al foro, pero al menos saluda y de paso debes leer las normas del foro, talvez despues de eso alguien se anima a colaborar contigo

Normas - Política - Términos | Ayuda Excel

Saludos

publicado
  • Autor

Buenas tarde tengo una duda sobre esta formulación, ya que no te da los datos exactos en dias y meses

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.