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?
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"
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?