Range Selection based on Date and cell.value

stevedhawes

Board Regular
Joined
Sep 11, 2007
Messages
112
Hi all,

Hoping someone can help me here, as im stumped.

I basically want to select a range of cells and make their value = "Booked", but the range will be based on the date. So all cells less than today (and those below it) should say "booked" only.

heres an example - so when a marco runs, it takes todays date and says make the cells value in range A1:G6 for all items less than or equal to today = booked. Note the date is only listed in row 1 though, so an offset of some kind is required i think.

BEFORE RUNNING THE MACRO

A B C D E F G
1 6/11/2013 7/11/2103 8/11/2013 9/11/2013 10/11/2013 11/12/2013 12/11/2013
2 2 5 4 4 45 4 4
3 2 4 5 6 3 0 8
4 3 4 5 5 7 7 7
5 1 1 2 1 3 3 3
6 4 3 3 3 2 1 1


AFTER RUNNING THE MACRO - Based on todays date which is 8/11/2013

A B C D E F G
1 6/11/2013 7/11/2103 8/11/2013 9/11/2013 10/11/2013 11/12/2013 12/11/2013
2 Booked Booked Booked 4 45 4 4
3 Booked Booked Booked 6 3 0 8
4 Booked Booked Booked 5 7 7 7
5 Booked Booked Booked 1 3 3 3
6 Booked Booked Booked 3 2 1 1

Thanks in advance for your help on this one

Steve
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
aah it didnt retain the rich text spacing, but hope you can see the gist of what im trying to achieve. thanks
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,027
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top