+ Reply to Thread
Results 1 to 7 of 7

Floating Text Box

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    81

    Floating Text Box

    I'm trying create a floating text box that has the following information:

    Key

    RED = Warehouse

    AMBER = Customer Services

    YELLOW = Sales

    GREEN = Complete

    Unfortunately, when I run the VBA on the spreadsheet I get "Compile error: Method or data member not found". Here is the VBA coding I'm using:

    Sub ShowTextBox()
    UserForm1.TextBox1.Text = "RED = Warehouse" & vbLf & "AMBER = Customer Services" & vbLf & "YELLOW = Sales" & vbLf & "GREEN = Complete"
    UserForm1.Show vbModeless
    End Sub

    When I get the error Sub ShowTextBox() is high lighted in yellow. I'm a real novice on VBA so this is a massive learning curve, if someone can help and explain in simple terms for a novice understanding that would be amazing.


  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Floating Text Box

    Check and see if the multiple line property of your textbox is set to true.

    If the data never changes maybe you should just put a label in your userform for each line.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Floating Text Box

    Quote Originally Posted by XeRo Solus View Post
    Check and see if the multiple line property of your textbox is set to true.

    If the data never changes maybe you should just put a label in your userform for each line.
    No the text will never change, so how would I do this?

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Floating Text Box

    Attachment 257746How about this?

  5. #5
    Registered User
    Join Date
    03-25-2013
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Floating Text Box

    That would be just what I need, can you point me in the right direction to enale something like this?

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Floating Text Box

    Quote Originally Posted by MatthewIJClark View Post
    That would be just what I need, can you point me in the right direction to enale something like this?
    enable? email?

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Floating Text Box

    What I did was create a userform with 4 labels. I changed the label caption to the 4 items you had listed. I changed the userform's caption to key.

    If you look through the properties window in VBE you can see where you have the option of changing font sizes and foreground colors to meet your requirements.

    The code for the button is simply
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. floating text box when scroll
    By NYBoy in forum Excel General
    Replies: 4
    Last Post: 05-18-2020, 09:30 AM
  2. How to add a floating text box in 2007
    By zhuowang1980 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2013, 03:54 PM
  3. Creating a floating text box containing a hyperlink
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-01-2013, 10:26 AM
  4. Floating Text Box
    By Phil Walters in forum Excel General
    Replies: 3
    Last Post: 11-12-2012, 06:06 AM
  5. [SOLVED] How do I add a floating text box in Excel?
    By Prashant in forum Excel General
    Replies: 1
    Last Post: 09-27-2005, 09:05 AM

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