Hi,
I'm looking for help on my VBA code.
I'm making a booking system using excel, users select a room, date and time and send the request with a button.
I've made the button return the informations in a seperate sheet that looks like that :
Now, without VBA I've used the following formula to check for availability and display it in a calendar :
Now I'd like to use the same formula in VBA to prevent double booking. I've got the IF part covered but I can't translate the formula above in VBA.
If you have any idea how to apply the formula in VBA that'd be great.
I'm looking for help on my VBA code.
I'm making a booking system using excel, users select a room, date and time and send the request with a button.
I've made the button return the informations in a seperate sheet that looks like that :
Room | Time | Date |
3110 | 08:10 | 02.12.21 |
3112 | 08:10 | 02.12.21 |
3110 | 09:20 | 02.12.21 |
Now, without VBA I've used the following formula to check for availability and display it in a calendar :
It returns a value = 1 if available, = 0 if already booked once and < 0 if booked more than once.=1-SUMPRODUCT((return!$B$2:$B$1000=Reservation!$D$5)*(return!$H$2:$H$1000=Reservation!$F11)*(return!$G$2:$G$1000=Reservation!G$10))
Now I'd like to use the same formula in VBA to prevent double booking. I've got the IF part covered but I can't translate the formula above in VBA.
If you have any idea how to apply the formula in VBA that'd be great.