I have a database in excel, here's some sample data.
When they click the print button in Cell A2, up comes my form
When the print tags button is pressed, my secondary sheet is populated with the cell they clicked on
Now it's using a font, calibri 11, which isn't proportional but I was wondering if there's a way in VBA to "auto" detect the max width and place words on the next row accordingly (like a word wrap). Here's what I need it to look like:
Here's my existing code to place the comments as is:
This is one of the last hurdles in a project I'm working on.
When they click the print button in Cell A2, up comes my form
When the print tags button is pressed, my secondary sheet is populated with the cell they clicked on
Now it's using a font, calibri 11, which isn't proportional but I was wondering if there's a way in VBA to "auto" detect the max width and place words on the next row accordingly (like a word wrap). Here's what I need it to look like:
Here's my existing code to place the comments as is:
Code:
entireComment = "Comments: " & Range("P" & i)
.Range("A" & cnt + 11).Value = Mid(entireComment, 1, 33)
If Len(entireComment) >= 36 Then
.Range("A" & cnt + 12).Value = Mid(entireComment, 36, 35)
End If
If Len(entireComment) >= 71 Then
.Range("A" & cnt + 13).Value = Mid(entireComment, 72, 35)
End If
If Len(entireComment) >= 106 Then
.Range("A" & cnt + 14).Value = Mid(entireComment, 107, 35)
End If
If Len(entireComment) >= 141 Then
.Range("A" & cnt + 15).Value = Mid(entireComment, 142, 35)
End If
If Len(entireComment) >= 176 Then
.Range("A" & cnt + 16).Value = Mid(entireComment, 177, 35)
End If
If Len(entireComment) >= 211 Then
.Range("A" & cnt + 17).Value = Mid(entireComment, 212, 35)
End If
This is one of the last hurdles in a project I'm working on.