Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Need VBA code to enter text into a textbox !!!!
Does anybody know one line of code that will allow me to
enter a number into a textbox on a worksheet. when I record a macro I get.. Sheets("venn").Select ActiveSheet.Shapes("Text Box 27").Select Selection.Characters.Text = "123" I thought this implies I could code this like so... Dim sht as sheet set sht = activesheet.shapes("Text Box 27") sht.characters.text = "123" set sht = nothing But this does not work !! what is the correct way of doing this ? |
#2
|
|||
|
|||
How about:
Option Explicit Sub testme() Dim sht As Worksheet Dim TBox As TextBox Set sht = ActiveSheet Set TBox = sht.TextBoxes("Text Box 27") TBox.Characters.Text = "123" Set sht = Nothing Set TBox = Nothing End Sub Art Ferdinand wrote: Does anybody know one line of code that will allow me to enter a number into a textbox on a worksheet. when I record a macro I get.. Sheets("venn").Select ActiveSheet.Shapes("Text Box 27").Select Selection.Characters.Text = "123" I thought this implies I could code this like so... Dim sht as sheet set sht = activesheet.shapes("Text Box 27") sht.characters.text = "123" set sht = nothing But this does not work !! what is the correct way of doing this ? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Autofitting a row | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
excel - numbers as text | New Users to Excel | |||
Is there a way I can enter a letter to proceed text a column of ce | Excel Discussion (Misc queries) |