You can add VBA code to your excel sheet for helping you converting Bambu Lab hex codes to cell colors. Just copy the Bambu Lab Hex code string in the cell you want to have the color and the cell color will change to the RGB color.
This will work with single hex codes (like #000000) as well as for gradient colors (like #E94B3C; #FFFFFF).
Safe your Excel Sheet as .xlsm.
Cursieve tekstThere are most likely better solutions, but this works for me…
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo bm_Safe_Exit
Application.EnableEvents = False
Dim rng As Range, clr As String
For Each rng In Target
Rem Determine if cell value is a single hex code
If Len(rng.Value2) = 7 And Left(rng.Value2, 1) = “#” Then
clr = Right(rng.Value2, 6)
rng.Interior.Color = _
RGB(Application.Hex2Dec(Left(clr, 2)), _
Application.Hex2Dec(Mid(clr, 3, 2)), _
Application.Hex2Dec(Right(clr, 2)))
rng.Font.Color = _
RGB(Application.Hex2Dec(Left(clr, 2)), _
Application.Hex2Dec(Mid(clr, 3, 2)), _
Application.Hex2Dec(Right(clr, 2)))
End If
Rem Determine if cell value is a gradient hex code
If Len(rng.Value2) = 16 And Left(rng.Value2, 1) = “#” Then
clr1 = Right(Left(rng.Value2, 7), 6)
clr2 = Right(rng.Value2, 6)
With rng.Interior
.Pattern = xlPatternLinearGradient
.Gradient.Degree = 0
.Gradient.ColorStops.Clear
End With
With rng.Interior.Gradient.ColorStops.Add(0)
.Color = _
RGB(Application.Hex2Dec(Left(clr1, 2)), _
Application.Hex2Dec(Mid(clr1, 3, 2)), _
Application.Hex2Dec(Right(clr1, 2)))
.TintAndShade = 0
End With
With rng.Interior.Gradient.ColorStops.Add(1)
.Color = _
RGB(Application.Hex2Dec(Left(clr2, 2)), _
Application.Hex2Dec(Mid(clr2, 3, 2)), _
Application.Hex2Dec(Right(clr2, 2)))
.TintAndShade = 0
End With
Rem Make cell text invisible as cell color is multi color
rng.NumberFormat = ";;;"
End If
Next rng
bm_Safe_Exit:
Application.EnableEvents = True
End Sub