Run-time error '1004': Method 'Range' of object'_Global'failed

NicoilGreco

New Member
Joined
Jun 8, 2015
Messages
1
Hi all and thanks in advance for your precious help. I'm trying without success to run the code below. Is there anyone who knows what's wrong?


Sub try1()


Dim ex_date As Range


Set ex_date = Range(Range("r51").Column, Range("r51").End(xlDown).Row)


Application.ActiveWorkbook.ActiveSheet.Range("ex_date").Select
Selection.Copy
Range("b51").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("b51").Select
Application.CutCopyMode = False


End Sub
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Code:
[COLOR=darkblue]Sub[/COLOR] try1()
[COLOR=darkblue]Dim[/COLOR] ex_date [COLOR=darkblue]As[/COLOR] Range

[COLOR=darkblue]Set[/COLOR] ex_date = Range(Range("r51"), Range("r51").End(xlDown).Row)

ex_date.Copy
Range("b51").PasteSpecial Paste:=xlPasteValues

Application.CutCopyMode = [COLOR=darkblue]False[/COLOR]

[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top