Fill cells with color

heruxz

New member
Joined
Apr 18, 2024
Messages
1
Programming Experience
Beginner
I am currently working on a project in which I can send a table with information through a chime chat from excel, the problem is that I don't know how to fill the colored cells through the macro since I don't want it to be just gray and white.

This is the code I'm currently using and the table looks black and white only.

VB.NET:
Sub postACSWMissing()
    ' Actually ALGR
    ' Selection of Excel of Workbook to Post
    Dim table As String
    Dim dsp_a As String
    dsp_a = Worksheets("Info").Range("F4").Value
    ' Selection.End(xlToRight)
    
    Sheets("Pivots & Chime").Select
    Range("E5").Select
    
    With Worksheets("Pivots & Chime").Range(Selection, Selection.End(xlDown))
        
        For Each Row In .Rows
            table = table & Join(Array(Empty, Row.Cells(1, 1), Row.Cells(1, 2), Row.Cells(1, 3)), "|") & Chr(10)
            If Row.Row = .Row Then: table = table & "|-|-" & Chr(10)
        Next
        
    End With

    Call announce("/md " & Left(table, Len(table) - 1), dsp_a)
    
    ActiveWindow.ScrollColumn = 8
End Sub

Currently the table looks like this:

Untitled.png
 
Is this really VB.NET or is it actually VBA in Excel? It's not clear from the code but Call is completely unnecessary in VB.NET so it's use makes it look like an older VB flavour.
 
Back
Top