Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code for column fill matching weekends
This will be easy for a VB coder: I have a row with calender dates across
about 100 days (cells E:DV). I want the colums representing weekends to be autofilled and remain unaffected by subsequent conditional formatting (or vb code). Then (this is the subsequent part) rows below must be filled between date ranges obtained from cells from columns, say C and D. Columns C being a start date and D an end date. Note I have used the WORKDAY FUNCTION to identify weekends through numbers 1 - 7, if that would help) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code for column fill matching weekends
On 15 mei, 12:24, Kobus wrote:
This will be easy for a VB coder: I have a row with calender dates across about 100 days (cells E:DV). *I want the colums representing weekends to be autofilled and remain unaffected by subsequent conditional formatting (or vb code). Then (this is the subsequent part) rows below must be filled between date ranges obtained from cells from columns, say C and D. *Columns C being a start date and D an end date. Note I have used the WORKDAY FUNCTION to identify weekends through numbers 1 - 7, if that would help) Hi Kobus, Assuming you have the startdate in cell C2 and the enddate in cell D2 You can solve this with conditional formatting only. For marking the weekends use the WEEKDAY function =WEEKDAY(E$1,2)5 For marking the days from your startdate unto and including the enddate add a second rule and use =AND(E$1=$C$2,E$1<=$D$2) Use the brush to copy these conditiond from column E to the right. HTH, Wouter |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code for column fill matching weekends
As you may have noticed I posted the same question twice (search Kobus and it
will pick it up). I think the AND should be OR. Something is not working yet, but thanks for sending me on the path. I thought VB would have been the answer as it may be more forgiving in adding and deleting columns. "Kobus" wrote: This will be easy for a VB coder: I have a row with calender dates across about 100 days (cells E:DV). I want the colums representing weekends to be autofilled and remain unaffected by subsequent conditional formatting (or vb code). Then (this is the subsequent part) rows below must be filled between date ranges obtained from cells from columns, say C and D. Columns C being a start date and D an end date. Note I have used the WORKDAY FUNCTION to identify weekends through numbers 1 - 7, if that would help) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code for column fill matching weekends
THE ERROR WAS WITH A DOLLAR SIGN
THANKS IT WORKS GREAT!! For marking the weekends use the WEEKDAY function =WEEKDAY(E$1,2)5 For marking the days from your startdate unto and including the enddate add a second rule and use =AND(E$1=$C2,E$1<=$D2) Use the brush to copy these conditiond from column E to the right. "Wouter HM" wrote: On 15 mei, 12:24, Kobus wrote: This will be easy for a VB coder: I have a row with calender dates across about 100 days (cells E:DV). I want the colums representing weekends to be autofilled and remain unaffected by subsequent conditional formatting (or vb code). Then (this is the subsequent part) rows below must be filled between date ranges obtained from cells from columns, say C and D. Columns C being a start date and D an end date. Note I have used the WORKDAY FUNCTION to identify weekends through numbers 1 - 7, if that would help) Hi Kobus, Assuming you have the startdate in cell C2 and the enddate in cell D2 You can solve this with conditional formatting only. For marking the weekends use the WEEKDAY function =WEEKDAY(E$1,2)5 For marking the days from your startdate unto and including the enddate add a second rule and use =AND(E$1=$C$2,E$1<=$D$2) Use the brush to copy these conditiond from column E to the right. HTH, Wouter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill in columns by matching a value on another sheet | Excel Discussion (Misc queries) | |||
Auto Fill days of the month (not including weekends) | Excel Worksheet Functions | |||
can I auto fill zip code column when city is typed | Excel Worksheet Functions | |||
Removing a matching code from another cell | Excel Worksheet Functions | |||
code to identify matching text | Excel Programming |