Reputation: 3685
I need to add a "padding-bottom" to a cell in VBA.
A way to get what I need might be to append to a cell a char with smaller font size (let's say a small dot) in a new line.
How can I achieve this in VBA?
Upvotes: 0
Views: 823
Reputation: 1017
The following will insert "my text" into range A1, you can adapt it as you need.
It works as follows:
Update the characters in Range A1 to font size 8, starting from the end of the previous text (using lOldTextLen)
Dim sText As String
Dim lOldTextLen As Long
sText = "my text"
lOldTextLen = Len(Range("a1"))
Range("a1").Value = Range("a1").Value & vbNewLine & vbNewLine & sText
Range("a1").Characters(lOldTextLen + 1).Font.Size = 8
Upvotes: 1