+ Reply to Thread
Results 1 to 8 of 8

Adding a textbox via command button

  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Adding a textbox via command button

    Good Day,

    I am trying to add a text box via command button, however, when I press the command button, nothing happens!
    My code is as follows:

    Private Sub addbox1_click()
    '
    ' Macro2 Macro
    ' Macro recorded 11/22/2006 by Jason
    '

    '
    ActiveSheet.Shapes.AddShape(msoShapeRectangle, 596.25, 177#, 132#, 45.75). _
    Select
    Selection.ShapeRange.Fill.Visible = msoFalse
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoFalse
    End Sub


    Thanks!
    Last edited by NewExcelUser; 11-22-2006 at 09:45 AM.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    With the macro recorder ...
    Please Login or Register  to view this content.
    HTH
    Carim

  3. #3
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    Hola,

    Thanks for the reply, however the textbox does not seem to appear?

    Does it need to be "activated" after it is created? If so, how do you do that?

    Thanks again!

  4. #4
    Registered User
    Join Date
    07-22-2005
    Location
    canada
    Posts
    73

    to activate a control...

    Hey,

    to activate a control :

    Please Login or Register  to view this content.
    HTH,

    oliver.

  5. #5
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    What I seem to have thought would be a pretty simple task, has turned into a not-so-simple task.

    When I click the command button, nothing happens.

    I have searched the web and found nothing on adding a text box via command button. With all the complexities of Excel, this has got to be possible right?

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Is your command button click procedure runs macro1 ?

    Carim

  7. #7
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    I got it! I think I had the code in the wrong area. I had it under General, so I just moved it to addbox1 and viola!

    Thanks to all who have responded!

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    See you were right ...

    a pretty simple task
    Thanks for the feedback

    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1