How can I use Excel data bars to format cells with text values?

I tried to do this yesterday - I don't believe you can achieve this with conditional formatting data bars, which can only apply to cells containing numerical values.

The way I got round it was to overlay a bar chart, removing all the backgrounds, borders, axes and gridlines, and setting the bar colour to be 60%+ transparent.

enter image description here


I was able to use Brynjar Hallmannsson's tip to recreate what Andi did.

Steps:
1. Type values for databars where the inputs will be i.e.(C2:C8).
2. Link databar cells to inputs (i.e. B2 Formula: =C2) - you can just use the data bar cells as inputs but your numbers wont be visible anywhere
3. Highlight databar cells and apply databar conditional formatting
4. Right click on databar cell B2 and go to Format Cells -> Number -> Custom -> Type:
5. Replace General with "Unknown" and click OK
6. Cell B2 will now say Unknown. Left Align the text.
7. Repeat steps 4 though 6 for each databar cell

You can use VBA if you want to control the text of the databars via another group of cells. Lets say D2:D8. Use the OnChange Event to format the Custom Type of the databar cell whenever the associated cell in column D is changed. Like so:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("D2:D8")) Is Nothing Then Target.Offset(0, -2).NumberFormat = Chr(34) & Target.Value & Chr(34)
End Sub

Steps 2 through 6:

Steps 2 through 6