Results 1 to 3 of 3

Thread: Appending strings to RefEdit instead of replacing

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    13

    Appending strings to RefEdit instead of replacing

    In Excel's userform, there is a special control called "RefEdit", it is similar to a textbox but is used to retrieve cell address(es).

    My question is: When you select a cell or drag a selection, the RefEdit control always replaces whatever text string you have in it with the cell address(es) of your selection. Is there a way to make it append instead of replace?

    For instance, when I run the userform, I type "A1+A2+" in the RefEdit control, then with the mouse I click on cell A3. I was hoping that the text in that RefEdit would change to "A1+A2+A3", but instead I got only "sheet_name!A3". It replaced whatever I typed previously with the cell address I just clicked. How do I append instead of replace?

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    Since no one else has replied...

    I don't know. The RefEdit control doesn't really work the same as the similar controls you see in Excel. I think more recent versions of RefEdit have some focus problems. You can append a cell reference to what you already have IF you click back on the RefEdit control before selecting the new cell. In other words, if you set focus back to the control after typing something in the control, the it will be ready to append a new cell reference...somtimes, sort of.

    I don't know of any property to change to make it work right. I think the only other way around would be to code the change events to set it to the text you actually want.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    13
    Thanks again, WorkHorse.

    Well in my case, it never did append any cell reference to what I already had in place, whether or not I gave it focus before selecting a cell. I tried coding in the BeforeDragEvent() as well some other related events to replace its value to what I wanted. But nope, it still insisted that "replace " was the better way. Maybe I didn't code it right. I don't know.

    Anyway, thanks for the reply. I'll just keep trying.

Posting Permissions

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



Click Here to Expand Forum to Full Width