#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Paste Link enters a 0 into the cell where I paste. How do I elemin UNR Excel Discussion (Misc queries) 4 March 28th 05 01:54 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM


All times are GMT +1. The time now is 05:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"