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.

Extraer de un date mm:ss

publicado

Hola, buenas tardes:

Les cuento mi problemilla, ojalá puedan ayudarme:

Pues bien, estoy haciendo una macro que me evalue tiempos, en base a una columna de celdas,

les platico, tengo tres casos de tiempos:

1.- dato_time >5:00:00 y dato_time <=9:30:00 ->conteo (checada= checada+1)

2.- dato_time <=5:00:00 -> Sumarlo el tiempo tal cual (acumulado=acumulado+tiempo_celda)

3.- dato_time >12:00:00 y dato_time<1:00:00 ->sumar únicamente minutos y segundos, no tomar en cuenta el la hora (el 12)

Lo empezé a codificar de ésta forma:

cad = Sheets(strnombrehoja$).Cells(fila, 15)
cad = Format(TimeValue(cad), "HH:MM:SS")

If cad > "05:00:00 a.m." And cad <= "09:30:00 a.m." Then
checada = checada + 1
Else
If cad <= "05:00:00 a.m." Then
tiempo = tiempo + cad
Else
If cad > "12:00:00 a.m." And cad < "01:00:00 a.m." Then
' tiempo_total=.........como extraer solo los minutos y segundos para sumarlos?
tiempo = tiempo + tiempo_total
End If
End If
End If
[/CODE]

Como extraer el valor de mm:ss para poder sumarlo al acumulado de tiempo_total?

Help me!

Featured Replies

publicado

Te dejo un ejemplo para extraer las horas, minutos y segundos:

hora = "12:00:55" 'asignamos una hora cualquiera
h = Format(Hour(hora), "00") ' extraemos la hora en este caso 12
m = Format(Minute(hora), "00") ' extraemos los minutos en este caso 00
s = Format(Second(hora), "00") ' extraemos los segundos en este caso 55
ti = h & ":" & m & ":" & s ' los unimos todos[/CODE]

PD. No funciona si le agregas el am o pm.

Salu2

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.