0

I am trying to figure out if and how it would be possible to implement something like a conditional statement for the excel spreadsheet my program writes to. The spreadsheet is created on the fly each time the program opens up. I would like to place a statement along the lines of: If cell A from column A has text, but cell B from column B has no text, then cell B would be highlighted red. Here is an example of the spreadsheet formatting code I have done.

       If EXCEL_LENGTH <> "" Then
                'APPLY FORMATTING FOR FIRST ROW
                With objws.Range(EXCEL_LENGTH)
                    .Font.Bold = True
                    .Font.Size = 12.5
                    .Interior.ColorIndex = 15
                    .Interior.Pattern = Excel.XlPattern.xlPatternSolid
                    .Font.Name = "Rockwell"
                    .Font.Underline = True
                    .Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue)

                End If
2
Contributors
1
Reply
12
Views
3 Years
Discussion Span
Last Post by kRod
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.