looking for some solutions? You are welcome.

SOLVED: First-time VBA - How to merge cells based on conditional cell values

Greg:

I am trying to figure out a way to use VBA (since I deduced I can't use regular excel functions) to read a cell's text, and then merge and center that cell with the adjacent cell(s) if they meet certain criteria.

For example, I have a cell that says "B6100-1, WJW 303, Class Length: 1.30 hrs. Start Time: 9:00 AM"

This specific cell is in a column under "9:00" since its start time is 9:00 AM.

But the class runs from 9:00 am to 10:30am, as indicated by the class length of 1.30.

I want this cell to merge and center cell B8 and C8, for example, if the cell states 9:00AM, with a length of 1.30 hours. So the cell would span from the 9:00 AM column to the 10:30 AM column. EDIT:

To be more clear. Image 1 is what I have now.

This is what it looks like now

I am trying to get excel to automatically do what is shown in image 2.

This is what I am trying to do with VBA



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent