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
- 16862 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago