+ Reply to Thread
Results 1 to 4 of 4

Copying text from text boxes

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    London, England
    MS-Off Ver
    Excel/Word/PPT 2003/2007
    Posts
    17

    Copying text from text boxes

    Hello...

    I need help with something that looks simple but I don't know how to do it. I have a text box in an excel 2003 sheet where people are supposed to answer a certain question and type text within the txt box. I then want to check if there is any text in the boxes or there is nothing. If there is nothing I want to show a warning to enter any txt in the boxes. My main questions are:

    1) I was thinking of selecting the txt box and copy the text in a nearby cell. Then I'll check if the length of the txt in the cell is equal to 0 or not. If it is I'll add a warning message. My missing part is how to select the txt box and then copy all the text within the box and paste it in cell A1 (for example). That would be enough, if someone knows more I'll also be happy with..
    2) An advice on how to make that test (copy the txt within the text box and check its length) when someone tries to close the file. Is there anyway of using vba to understand when someone tries to close the file, and then do something else before the file closes?

    Thanks a lot for any help. edit: I just realized that I should have posted my thread in the "excel programming" area and not here. My questions involves VBA obviously. Sorry for that.
    Last edited by johngr55; 05-09-2010 at 02:23 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying text from text boxes

    Why not just use cells?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Copying text from text boxes

    What kind of text box -- from the Forms toolbar or Control Toolbox?

    EDIT:
    Why not just use cells?
    Ditto.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    02-18-2009
    Location
    London, England
    MS-Off Ver
    Excel/Word/PPT 2003/2007
    Posts
    17

    Re: Copying text from text boxes

    I know that's easier to use input cells for that but I have some reasons for not doing it. Mostly because I want to let others who use the spreadsheet to be able to easily remove the text from excel to word or other applications. Copying text from a cell is not as easy as copying from a txt box (you can't just highlight the text and copy it, you must go to the text area in the options bar above the cells' area and select the txt from there, or just click on the cell and copy it but that pastes the txt in word as a table and not as just text). If I don't have any other options I'll have to use a cell. Thanks

+ 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