Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can I work with worksheet textboxes in VBA?
I have several textboxes on an Excel worksheet. Is there a way to access
(change contents, formatting,...) these textboxes from within my VBA code? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can I work with worksheet textboxes in VBA?
Using the control from the Controls Toolbox:
Sub txtbx() Sheets(1).TextBox1.Text = "Hello" MsgBox Sheets(1).TextBox1.Text Sheets(1).TextBox1.Font.Italic = True Sheets(1).TextBox1.Text = "" End Sub "Pat D" wrote: I have several textboxes on an Excel worksheet. Is there a way to access (change contents, formatting,...) these textboxes from within my VBA code? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can I work with worksheet textboxes in VBA?
I should've clarified a bit more...
what you are saying is workable for ActiveX or Form Controls. I am referring to a textbox from the Insert menu (Office 2007). The reason why I am using a plain text box is that I need to include a bullet list in the text box, but I want to be able to alter the contents of the bulleted list from my VBA code... "JLGWhiz" wrote: Using the control from the Controls Toolbox: Sub txtbx() Sheets(1).TextBox1.Text = "Hello" MsgBox Sheets(1).TextBox1.Text Sheets(1).TextBox1.Font.Italic = True Sheets(1).TextBox1.Text = "" End Sub "Pat D" wrote: I have several textboxes on an Excel worksheet. Is there a way to access (change contents, formatting,...) these textboxes from within my VBA code? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can I work with worksheet textboxes in VBA?
On Mar 20, 10:46 pm, Pat D <Pat wrote:
I have several textboxes on an Excel worksheet. Is there a way to access (change contents, formatting,...) these textboxes from within my VBA code? Text boxes are Shape objects. Examples: ActiveSheet.Shapes("Text Box 1").TextFrame.Characters.Text = ActiveSheet.Shapes("Text Box 1").TextFrame.Characters.Text & Chr(10) & "That's all folks." Adds a new line and "That's all folk." to Text Box 1 ActiveSheet.Shapes("Text Box 1").TextFrame.Characters(20, 25).Font.Bold = True Makes 25 characters, starting at the 20th character, Bold. Ken Johnson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can I work with worksheet textboxes in VBA?
Thanks!
"Ken Johnson" wrote: On Mar 20, 10:46 pm, Pat D <Pat wrote: I have several textboxes on an Excel worksheet. Is there a way to access (change contents, formatting,...) these textboxes from within my VBA code? Text boxes are Shape objects. Examples: ActiveSheet.Shapes("Text Box 1").TextFrame.Characters.Text = ActiveSheet.Shapes("Text Box 1").TextFrame.Characters.Text & Chr(10) & "That's all folks." Adds a new line and "That's all folk." to Text Box 1 ActiveSheet.Shapes("Text Box 1").TextFrame.Characters(20, 25).Font.Bold = True Makes 25 characters, starting at the 20th character, Bold. Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tab Function for textboxes on Worksheet not UserForm | Excel Programming | |||
Autosize bug in Excel 2007, textboxes, work arounds | Excel Programming | |||
Managing Textboxes in a Worksheet | Excel Programming | |||
aligning textboxes on worksheet by cell reference? | Excel Programming | |||
Textboxes on a worksheet | Excel Programming |