ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cut&paste (https://www.excelbanter.com/excel-programming/309730-cut-paste.html)

Daniel Lidström

cut&paste
 
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!

--
Daniel

No Name

cut&paste
 
hi, Try:

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

This will copy q35:q40 to r35.


-----Original Message-----
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!

--
Daniel
.


Gord Dibben

cut&paste
 
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

On Mon, 13 Sep 2004 09:24:08 +0200, Daniel Lidström
wrote:

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!



Daniel Lidström

cut&paste
 
On Mon, 13 Sep 2004 09:06:08 -0700, Gord Dibben wrote:

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

Gord Dibben

cut&paste
 
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

On Tue, 14 Sep 2004 09:10:09 +0200, Daniel Lidström
wrote:

On Mon, 13 Sep 2004 09:06:08 -0700, Gord Dibben wrote:

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?




All times are GMT +1. The time now is 08:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com