Vba Macro Help -Possibly a fomula

DaveR

Board Regular
Joined
May 10, 2006
Messages
176
What I am trying to achieve is this; I have a 'Date of refferal' in Column H, what I want to happen it that when this is filled in, Column I then offers two days which are either the following Wednesday, or the Wednesday after that?

All help greatfully recieved.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I'm currently looking at http://www.ozgrid.com/VBA/excel-calendar-dates.htm

So I currently have this set up, but would like the Userform to trigger on a date entry in Column H and ideally highlight in Red the following two Wednesdays as options.

Thanks for the help so far, but looking at it closer I don't think a formula will give me what I would like.
 
Upvote 0
I would use Andrew's formula, and a similar one for the other Wednesday, in another part of the sheet, and refer to those 2 cells in Data Validation/List for an in-cell drop-down.
 
Upvote 0
Thats is actually a cunning plan!

I'll have a go now........

Thanks for the inspiration (and the original formula)!
 
Upvote 0
Almost there!

The Formula;

=IF(ISNUMBER(H1),H1-WEEKDAY(H1)+4+(7*(WEEKDAY(H1)>3)),"")

works fine and my 'cever' bodge to make it work for the following 7 day i.e. cell value+7 now fills the cell with #value if the refreance cell is blank.

How do I change the above formula to calulate 2 weeks in advance? (I've tried the obvious changing 7 to 14 but that didn't work).
 
Upvote 0
Thank for this!

Now the next problem begins.....

What I would like to do is after the date is selected in Column I (either of the following wednesday), I would like to Generate a dynamic list for Column J were there is a series of times available i.e. 9.00am, 9.20am 9.40 am etc.

This is straightforward, however I want to ensure the list of available times only contains those times that havent already been booked on that date?

All suggestions on how to accomplish greatly recieved.
 
Upvote 0
So there must be a list of bookings for that day, with times, somewhere. Can you describe that?
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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