Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel RefEdit Control doesn't work the way I'd hoped

Status
Not open for further replies.

MeGustaXL

Technical User
Aug 6, 2003
1,055
GB
This should be dead simple:

1. Put a RefEdit Control on a worksheet (from the Control Toolbox).
2. Add a Button beneath it.
3. Name cell D1 "AddressLine" (or anything you like).
4. Code the button like this:

Private Sub CommandButton1_Click()
Range("AddressLine").Value = RefEdit1.Value
End Sub

5. Drag over cells A1 to A10, click the button and D1 reads "Sheet1!$A$1:$A$10".

Only it doesn't work. The RefEdit doesn't collapse when you click its button, nothing appears in it when you drag over or select any cells, and D1 stays blank.

The only time it works is if you type something in the RefEdit box, like "BLABBER", then press the button, D1 reads 'BLABBER'

What am I doing wrong?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top