Insert colored row with data if empty

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
743
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
This is the last piece of this particular set of macros I need to complete this. If I have a situation on my Flight Information Display (FIDS), where under the row beginning with Destination is blank, I need a VBA where it will insert a colored row under "Destination". The color will be either be the other blue that is not already used. The blue tone used with the date will not be used. In the image the lighter tone of blue would be used in row 11. However there may be times with the row containing "Destination" will be in the lighter blue. The word "NO DEPARTURES" will be in column A of the newly inserted row and the other cells in the row left blank. The font will be white, centered and 28. It may not be necessary to worry about the font for I have a VBA that is used to adjust that. I currently using the VBA given to me, but right now nothing seems to happen.
Thank you,


No Departures.JPG


VBA Code:
Sub Format_FID_ROWS()
Dim i, Count As Long
Dim wsAct As Worksheet

  Set wsAct = ActiveSheet
  Application.ScreenUpdating = False
  With Sheets("Outbound FIDS")
    .Activate
i = 1
Count = Sheets("Outbound FIDS").Cells(Rows.Count, "A").End(xlUp).Row
Do While i <= Count
    If Cells(i, 1) = "" And Cells(i, 2) = "" And Cells(i, 4) = "" Then
        Else
        Range(Cells(i, 1), Cells(i, 4)).Interior.Color = RGB(45, 45, 185)
    End If
       i = i + 1
     
    If i > Count Then
        Exit Do
    End If
    If Cells(i, 1) = "" And Cells(i, 2) = "" And Cells(i, 4) = "" Then
        Else
        Range(Cells(i, 1), Cells(i, 4)).Interior.Color = RGB(34, 34, 147)
    End If
        i = i + 1
Loop
End With
wsAct.Activate
  Application.ScreenUpdating = True
End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

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