Hello forum,
A little out of my league here with Labels that aren't being used within charts. The attached workbook has my example that I'm hoping will make more sense.
I am trying to create a scheduling tool that will adjust label sizes according to Start and Finish dates that are given in columns C and D. A code a colleague of mine has produced seems to do the trick, but with static ranges. I'd like for a loop to cycle through column A, and bin the necessary fruits according to column G, and have the label code (or some variant thereof) execute and incorporate a new label for each piece of fruit, signaling it's duration or shelf life.
Label code given below:
Public Sub LabelPlacementTesting()
Dim ws As Worksheet, Lwidth As Integer, Lheight As Integer: Set ws = ThisWorkbook.Worksheets("Example")
Lwidth = ws.Range("J3").Left - ws.Range("H3").Left
Lheight = ws.Range("J4").Top - ws.Range("J3").Top
ws.Shapes.AddLabel(msoTextOrientationHorizontal, ws.Range("H3").Left, ws.Range("H3").Top, Lwidth, Lheight).TextFrame.Characters.Text = "Test Label"
End Sub
Hopefully this explanation wasn't clear as mud!?
Bookmarks