Shapes With VBA - Display the cell value in a text
Use below lines to display the cell value in a text-box and then re-size the text-box as per the length of text
Sub cellvalue_in_textbox()
' display cell value in textbox
Sheets(1).Shapes("TextBox 1").TextFrame.Characters.Text = Range("b3").Value
' autosize the textbox as per the length of text
Sheets(1).Shapes("TextBox 1").TextFrame.AutoSize = msoAutoSizeTextToFitShape
End Sub
»
- Ashish Koul's blog
- Login or register to post comments
- 16895 reads
Recent comments
5 years 42 weeks ago
6 years 28 weeks ago
6 years 40 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 49 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago