Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Drew,
First a small warning: A sheet only has 256 columns, so you would not be able to record a full year. I have cooked this macro to reset the borders for each week: Sub NewEndOfWeek() ' ' NewEndOfWeek Macro ' This macro is created by Executor on 19 jan 2005 ' ' Dim lngLastRow As Long Dim lngLastCol As Long Dim lngLoopCOls As Long Dim strLast As String lngLastRow = Range("A1").SpecialCells(xlCellTypeLastCell).Row lngLastCol = Range("A1").SpecialCells(xlCellTypeLastCell).Colum n For lngLoopCOls = 2 To lngLastCol If IsDate(Cells(1, lngLoopCOls)) Then If Weekday(Cells(1, lngLoopCOls)) = vbSunday Then Range(Cells(1, lngLoopCOls), Cells(lngLastRow, lngLoopCOls)).Select Selection.Borders(xlEdgeLeft).LineStyle = xlNone ElseIf Weekday(Cells(1, lngLoopCOls)) = vbWednesday Then Range(Cells(1, lngLoopCOls), Cells(lngLastRow, lngLoopCOls)).Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlAutomatic End With End If End If Next Range("A1").Select End Sub Hoop this helps Executor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Record a macro will not edit composite drawing object | New Users to Excel | |||
Using a macro to add borders | Excel Programming | |||
problem when drawing textboxes in excel using macro | Excel Programming | |||
Macro for LOTO Drawing! | Excel Programming | |||
Selecting drawing objects or shapes in a macro | Excel Programming |