Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/08/2008, 17:29
Eleovildo
 
Fecha de Ingreso: agosto-2008
Mensajes: 4
Antigüedad: 15 años, 8 meses
Puntos: 0
Modificar una macro de Excel

Hola a todos:

Tengo la siguiente macro de Excel en una hoja de trabajo:



Sub ShowWeeks()
Dim iToday As Variant
Dim iYesterday As Variant
Application.ScreenUpdating = False

Range("B7").Select
iYesterday = Weekday(ActiveCell.Value)
Do Until IsEmpty(ActiveCell.Value)
ActiveCell.Offset(1, 0).Select
iToday = Weekday(ActiveCell.Value)
If iToday < iYesterday Then
ActiveCell.EntireRow.Insert
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.FormulaR1C1 = "Sub Total"
ActiveCell.Offset(1, 0).Select

End If
iYesterday = iToday
Loop
Range("B7").End(xlDown).Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.FormulaR1C1 = "Sub Total"
ActiveCell.Offset(1, 0).Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.FormulaR1C1 = "Total General"
Range("A1").Select
End Sub

En la celda B7 tengo la fecha de inicio de mes (01/01/2008), la cual arrastro hasta el último dia (31/01/2008).

Cuando ejecuto dicha macro me produce un listado del mes en curso dividido en
semanas, pero las semanas comiensan en Domingo y yo quiero que comiencen en Lunes, alguien podria echarme una mano con esto.



Saludos.........