+ Reply to Thread
Results 1 to 10 of 10

Get textbox to record user selected area

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Get textbox to record user selected area

    I am trying to get a textbox to record an area selected by a use (the same way that it is done in graphs) but I am at a loss how it is done. Any ideas?
    What doesn't kill you is just biding it's time

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get textbox to record user selected area

    Hi, nemmi69,

    Textbox in a worksheet or on a UserForm?

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Get textbox to record user selected area

    The textbox is on a worksheet. The graph textbox does not use an inputbox you just click it the highlight the area concerned and that shows in the textbox.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get textbox to record user selected area

    Hi, nemmi69,

    I think what you are talking about is not a TextBox but the RefEdit-Control which features the showing of the address and the possiblility to either enter directly or via chossing the range with the mouse. Maybe check that control out.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Get textbox to record user selected area

    Yes that's what I am trying to emulate

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get textbox to record user selected area

    Hi, nemmi69,

    sorry but to my knowledge you would need 2 controls for that: the textbox to display the address and a dropdpon which lets you enter the address manualy or select via Mouse / Keyboard. Maybe you could have a look at Alternative to Excel’s Flaky RefEdit Control.

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Get textbox to record user selected area

    My problem seeems that all the examples have user forms and i just have the textbox on the worksheet.

  8. #8
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Get textbox to record user selected area

    Well I came up with this for a textbox on a worksheet. At the moment it only works for the current workbook though on any worksheet.

    So :-
    1] How do you get it to work for other workbooks?
    2] Does anyone see anything wrong with this or other problems?

    In ThisWorkbook
    Please Login or Register  to view this content.
    In Sheet1 where the textbox resides
    Please Login or Register  to view this content.
    In Module
    Please Login or Register  to view this content.

  9. #9
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get textbox to record user selected area

    Hi, nemmi69,

    you work exclusively with the active workbook and the active sheet in your code. If you have set a range the Parent of this will give you the worksheet name, Parent.Parent will deliver the name of the workbook (untested):
    Please Login or Register  to view this content.
    Ciao,
    Holger

  10. #10
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Get textbox to record user selected area

    Well I was looking for this to be able to take a range from a different workbook.

+ 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