I'm creating an airline schedule in Excel. It needs to look like this:
Unfortunately, text in these non-blank cells does not overlap adjacent cells, because the adjacent "blank" cells all have formulae within them (even though the value of the formulae is ""). Note that each column represents one hour of time. Thus my spreadsheet looks like this instead:
I believe the only way to create the look I want is to write a macro. The process would be, for each of the eight rows shown, to loop through each column and identify non-blank cells. Then for all such non-blank cells, if the cells represent a flight departure (e.g. from WUH in blue - I can create a test for this, such as if the cell to it's left is blank), I need to select that cell and the four cells to its right, and then merge-and-left-justify. If the cells represent a flight arrival (e.g. WUH in red, or MCO), I need to select the cell, copy the value-only of its contents to the cell 4 to its left, then select that cell and the four to its right, then merge-and-right-justify.
Can someone please help me with this code, as I am a complete novice at VBA? The part I need the most help on is selecting a range of cells adjacent to a non-blank cell during the looping process. Note I'm also a novice at Stack Overflow, so if I have failed to ask the question properly, please let me know.