Consulting

Results 1 to 3 of 3

Thread: vba adding image after clicking on the textbox

  1. #1

    Question vba adding image after clicking on the textbox

    Hi,

    I'm new to VBA programming so thank you in advance for any help.
    I need to assign image to the textbox to work this way: when I click on the text box, then the image is showing.
    I think the easiest way is changing textbox to commandbutton and making userform with image. Unfortunetly, i got a lot of this textboxes near to each other and the commandbutton have this thick frame.
    Do you have a idea how to assign userform to the text box or how to erase this frame?

    Regards

  2. #2
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Why not use a button form control which you can make as small as you like. then assign a macro to it which shows the userform:

    Sub showim()
    UserForm1.Show
    
    
    End Sub

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I don't know what you mean by "image is showing". You could use an ActiveX textbox and use its methods.

    Private Sub TextBox1_GotFocus()
    MsgBox "Test"
    End Sub
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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