Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill in columns by matching a value on another sheet Xhawk57 Excel Discussion (Misc queries) 3 August 13th 08 03:32 PM
Auto Fill days of the month (not including weekends) John Krsulic[_2_] Excel Worksheet Functions 6 July 2nd 07 04:47 PM
can I auto fill zip code column when city is typed Elsie C. Excel Worksheet Functions 1 September 28th 06 08:40 PM
Removing a matching code from another cell yellow281 Excel Worksheet Functions 5 July 29th 05 02:07 PM
code to identify matching text andy hackett[_6_] Excel Programming 0 November 16th 04 08:17 AM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"