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.

Control horas de entrada

publicado

Hola panas , les cuento , estoy haciendo una macro que toma dos libros , uno se llama control (lleva las horas de ingreso de los empleados) y el otro es libro tiene como nombre el numero del dia (1.xls, 2.xls, etc)

Tengo una macro hecha , pero no me funciona, la idea es la siguiente , en el libro control , al estar sobre la celda del dia (fila dos) , la macro debe obtener el valor de la celda , cargar y activar el libro correspondiente (ahi no funka ) ; estando en el libro activo numero 13 por ejemplo , hay tres filas, la macro inserta una formula en la columna 4 ve si la columna tres dice inventario , si es asi toma l hora que corresponde , si no toma otra decision , etc , son dos consultas SI anidadas. Debe hacer esta operacion hasta que encuentra un texto que dice aqui .

Bueno y para finalizar , la macro activa el libro control e inserta la funcion buscav (o consultav) y busca el nombre del empleado con el nombre del empleado en la matriz del libro que tiene nombre del dia y carga las horas hasta el texto aqui.

Si me puede ayudar se los agradesco un monton

Sub Macro3()

librotimbraje = ActiveWorkbook.Name
nombrehoja = ActiveSheet.Name
fila = ActiveCell.Row
columna = ActiveCell.Column
fila = fila + 1
dia = ActiveCell.Value


Windows(dia).Activate
Sheets("Hoja1").Select

Dim filafinal As Long

Set V = Cells.Find("aqui")
If Not V Is Nothing Then
filafinal = V.Row


Else
MsgBox "no se encontro texto": Exit Sub
End If

scroll = 3 - filafinal

ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]=""inventario"",RC[-2],IF(RC[-2]<R1C2,R1C2,RC[-2]))"

Range("D3").Select
Selection.AutoFill Destination:=Range(Cells(3, 4), Cells(filafinal, 4)), Type:=xlFillDefault

Range(Cells(3, 4), Cells(filafinal, 4)).Select
ActiveWindow.SmallScroll Down:=-scroll
Selection.NumberFormat = "h:mm;@"

'Range("E14").Select
'ActiveWindow.SmallScroll Down:=21

Windows(librotimbraje).Activate
Sheets(nombrehoja).Select

'ActiveWindow.SmallScroll Down:=-6

Range(Cells(3, columna)).Select

'ActiveCell.FormulaR1C1 = ""
'Windows("timbraje 13-11-13.xls").Activate
'ActiveWindow.SmallScroll Down:=-12
'Windows("Timbraje Modulo.xls").Activate

ActiveCell.FormulaR1C1 = _
"=IF(ISERROR(VLOOKUP(RC[-13],'[dia & .xls]Hoja1'!R3C1:R37C4,4,FALSE)),"""",VLOOKUP(RC[-13],'[dia & .xls]Hoja1'!R3C1:R37C4,4,FALSE))"

Range(Cells(fila, columna)).Select

Dim filafinal2 As Long

Set W = Cells.Find("aqui")
If Not W Is Nothing Then
filafinal2 = W.Row
Else
MsgBox "Texto aqui No encontrado": Exit Sub
End If

scroll2 = fila - filafinal2

Selection.AutoFill Destination:=Range(Cells(fila, columna), Cells(filafinal2, columna)), Type:=xlFillDefault
Range(Cells(fila, columna), Cells(filafinal2, columna)).Select
ActiveWindow.SmallScroll Down:=scroll2
Selection.NumberFormat = "h:mm;@"
ActiveWindow.SmallScroll Down:=scroll2
End Sub[/CODE]

macrolistado.rar

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.