cut&paste

  • Thread starter Thread starter Daniel =?iso-8859-1?Q?Lidstr=F6m?=
  • Start date Start date
D

Daniel =?iso-8859-1?Q?Lidstr=F6m?=

Hi!

How can I cut and paste a range of cells into another place? I'm trying
with:
Sub HidePersonal()
Range("Q35:Q40").Select
Selection.Copy
Selection.Clear
End Sub
Sub UnhidePersonal()
Range("Q35:Q40").Paste
End Sub

But this doesn't work (error 438). How can this be done?
Thanks!
 
hi, Try:

Range("Q35:Q40").Copy Range("R35")

This will copy q35:q40 to r35.
 
Daniel

Sample code......adjust to suit.

Note you don't need to use .Select

Public Sub cut_clear()
Worksheets("Sheet2").Range("Q35:Q40").Cut _
Destination:=ActiveSheet.Range("K43")
End Sub


Gord Dibben Excel MVP
 
Daniel

Sample code......adjust to suit.

Note you don't need to use .Select

Public Sub cut_clear()
Worksheets("Sheet2").Range("Q35:Q40").Cut _
Destination:=ActiveSheet.Range("K43")
End Sub

Well, the problem is that I have to have two separate routines, and do the
cut in one of them and the paste in the other. Can your sample be modified
in this way?
 
Daniel

One way.......

Sub cut_it()
Range("Q35:Q40").Cut
End Sub

Sub paste_it()
Sheets("Sheet3").Activate
With ActiveSheet
..Paste Destination:=Range("M4")
End With
End Sub

Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top