Cloud Stack Ninja

Flight Schedule

enter image description here

I have a flight schedule consisting for 6 columns. On the image you see you can only see four, those are cut from a central database. The last 2 columns "SEATS" and "REMARKS" will be manually put it. I've got the coding for the four which I have inserted at the bottom of the rows, which in-fact they would serve as Headers for the next day. I'm looking how to make these headers which i managed through VBA to after the last data for the last day posted on the worksheet. I would like these to appear at the end of each day.The second part is for the last two columns how can I anchor them to the other columns so they will appear on the same row as the others.

Sub Headers()
Dim lastrow As Long
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row + 2
ActiveSheet.Cells(lastrow, "B").Value = "FLIGHT #"

lastrow = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).Row + 2
ActiveSheet.Cells(lastrow, "C").Value = "A/C TYPE"

lastrow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row + 2
ActiveSheet.Cells(lastrow, "D").Value = "ROLL CALL"

lastrow = ActiveSheet.Cells(Rows.Count, "E").End(xlUp).Row + 2
ActiveSheet.Cells(lastrow, "E").Value = "SEAT RELEASE"

lastrow = ActiveSheet.Cells(Rows.Count, "F").End(xlUp).Row + 2
ActiveSheet.Cells(lastrow, "F").Value = "REMARKS"

End Sub


Read more here: https://stackoverflow.com/questions/64398698/run-header-under-each-group-of-days

Content Attribution

This content was originally published by Sheridan Whiteside at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: