How do I have excel highlight days before & after a date on a cale

M

Moovysheek

How do have excel highlight 15 days prior to a chosen date on the calendar
below & 30 days after?

2010

JANUARY FEBRUARY
S M T W T F S S M T W T F S
1 2 1 2 3 4 5 6
3 4 5 6 7 8 9 7 8 9 10 11 12 13
10 11 12 13 14 15 16 14 15 16 17 18 19 20
17 18 19 20 21 22 23 21 22 23 24 25 26 27
24 25 26 27 28 29 30 28
31

MARCH APRIL
S M T W T F S S M T W T F S
1 2 3 4 5 6 1 2 3
7 8 9 10 11 12 13 4 5 6 7 8 9 10
14 15 16 17 18 19 20 11 12 13 14 15 16 17
21 22 23 24 25 26 27 18 19 20 21 22 23 24
28 29 30 31 25 26 27 28 29 30

MAY JUNE
S M T W T F S S M T W T F S
1 1 2 3 4 5
2 3 4 5 6 7 8 6 7 8 9 10 11 12
9 10 11 12 13 14 15 13 14 15 16 17 18 19
16 17 18 19 20 21 22 20 21 22 23 24 25 26
23 24 25 26 27 28 29 27 28 29 30
30 31

JULY AUGUST
S M T W T F S S M T W T F S
1 2 3 1 2 3 4 5 6 7
4 5 6 7 8 9 10 8 9 10 11 12 13 14
11 12 13 14 15 16 17 15 16 17 18 19 20 21
18 19 20 21 22 23 24 22 23 24 25 26 27 28
25 26 27 28 29 30 31 29 30 31

SEPTEMBER OCTOBER
S M T W T F S S M T W T F S
1 2 3 4 1 2
5 6 7 8 9 10 11 3 4 5 6 7 8 9
12 13 14 15 16 17 18 10 11 12 13 14 15 16
19 20 21 22 23 24 25 17 18 19 20 21 22 23
26 27 28 29 30 24 25 26 27 28 29 30
31

NOVEMBER DECEMBER
S M T W T F S S M T W T F S
1 2 3 4 5 6 1 2 3 4
7 8 9 10 11 12 13 5 6 7 8 9 10 11
14 15 16 17 18 19 20 12 13 14 15 16 17 18
21 22 23 24 25 26 27 19 20 21 22 23 24 25
28 29 30 26 27 28 29 30 31
 
D

Don Guillett

The simplest approach is to have your dates in a column and use this
inserted into the sheet module .
Then when you select a cell in col A the 45 day block will be shown in
yellow

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns(1).Interior.ColorIndex = xlColorIndexNone
mr = Application.Max(1, Target.Row - 15)
Cells(mr, 1).Resize(45) .Interior.ColorIndex = 6
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top