Refedit Paste

B

Basta1980

Hi,

I want colleagues to select the cel where they paste data in by using a
refedit (after they selected the cell, a set of other commands execute other
tasks such as copy data). Is this possible?!

Regards

Basta
 
B

Basta1980

Hi Jan Karel,

Thanks. Can you also tell me how to use the range specified with the refedit
can be use to paste content in?

Bas
 
J

Jan Karel Pieterse

Hi Basta1980,
Thanks. Can you also tell me how to use the range specified with the refedit
can be use to paste content in?

The example file you can download has this routine in Module1:

Sub Test()
Dim oRangeSelected As Range
If SelectARange("Please select a range of cells!", "SelectARAnge Demo",
oRangeSelected) = True Then
MsgBox "You selected:" & oRangeSelected.Address(, , , True)
Else
MsgBox "You cancelled"
End If
End Sub

Instead of that, you could use something like:

Sub Test()
Dim oRangeSelected As Range
dim vValue as variant
vValue=Selection.cells(1,1).Value
If SelectARange("Please select a range of cells!", "SelectARAnge Demo",
oRangeSelected) = True Then
oRangeSelected.Value = vValue
Else
MsgBox "You cancelled"
End If
End Sub

This would put the value in the currently selected cell into the newly selected
range.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com
 
Top