Share via

Excel Databars fill height.

Anonymous
2023-10-25T15:32:11+00:00

Dear Community,

I have made a condition where these databars, are done in black, on a background fill color that changes depending on a certain number, hence the gradient.
But as You see, the black databar does not fill the full height of the bar. Which creates these disturbing small lines.
Anyone have a good suggestion for this?

(I already tried to fill them all with thick borders, didn't help)

Kind Regards

CG

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Andreas Killer 144.1K Reputation points Volunteer Moderator
2023-10-26T07:01:37+00:00

Christoffer,

The only workaround I found is to draw a rectangle with a thick black frame and no fill over the cell.

.

Make a suggestion to Microsoft, a colored databar looks a nice and useful.
How do I give feedback on Microsoft Office? - Office Support

Andreas.

Sub Test()
Dim Ws As Worksheet
Dim R As Range
Dim Sh As Shape
Set Ws = ActiveSheet
#If Develop Then
'Delete all existing shapes
For Each Sh In Ws.Shapes
If Sh.Type <> msoComment Then Sh.Delete
Next
#End If
For Each R In Range("D1:E37")
Set Sh = Ws.Shapes.AddShape(msoShapeRectangle, R.Left, R.Top, R.Width, R.Height)
With Sh
.Fill.Visible = False 'No fill
With .Line
.Visible = True 'Add frame
.Weight = 3 'Thickness
.ForeColor.RGB = 0 'Color
End With
End With
Next
End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-10-25T18:00:43+00:00

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-10-26T09:24:26+00:00

    Thanks for your time Andreas!

    Yes, there definitely should be a way to have color based databars depending on values etc. Will make a suggestion, since now I just created a "hacky" way of achieving it.

    In the meantime, that really looked good when the lines went away. How exactly did you manage to do it by drawing a rectangle?
    I'm not that skilled in Excel, is the rectangle a free hand drawing or is it bound by the cell, is it time consuming if you have 100s of cells?
    I'm a novice in these areas :)

    I see now you added a script, will see if I understand how to use it!

    Cheers

    Christoffer

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-10-25T16:28:29+00:00

    We need to see this or an example file that shows the issue.

    Andreas.

    Was this answer helpful?

    0 comments No comments