Merging cell to the right based on value.

Coretex

New Member
Joined
Jul 19, 2016
Messages
9
Hello, I have a timetable, I am looking to be able to merge the cells of how long a class is running for.

This is my range, Set rngMerge = Range("C3:L11") 'Set the range limits here

The timetable is very basic,

9 9:30 10 10:30 11 etc...
Mon
Tue
Wed
Thur
Fri

I currently have the information of the course passed to the start time of the course, so just in cell C4 for example, I need to be able to have the cells merge to the right for when it ends.

I am currently trying to do this by EndTime - Starttime, this gives me how many minutes the course runs for, I divide this by 30 (interval) This gives me the number of cells that I should merge it to the right for.

How can I translate this into code using a For Each cell In rngMerge, thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Where do you have Start time and , and End time?

can you post the table if possible?
 
Upvote 0
The start and end times are just cells A2 and A4 on another sheet, it uses a drop down time list, so 9, 9:30, 10 etc
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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