PC Review


Reply
Thread Tools Rate Thread

Copy & paste row in anther worksheet

 
 
Grey
Guest
Posts: n/a
 
      28th Aug 2004
how to copy & paste and Cut & paste data row from one worksheet or another
one worksheet??

The requirement is I need to create a new worksheet first, and the copy &
paste or cut & paste a data row from one exist worksheet to the newly
created worksheet.

because i am a novice in writing VBA in Excel , pls help


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      28th Aug 2004
The easiest way to learn this kind of stuff is to record a macro when you do it
manually.

In fact, record two while you try both options.

I like to add the worksheet first, then do the cut/copy, then paste.

Sometimes, there are things that make xl lose the the cut/copy information and I
find it's safer to put the cut/copy close together in the code.

And after you record the macro, take a look at the code. Excel records all your
selects and activates. You can clean it up and it may look a little like:

option explicit
sub testme01()

dim newwks as worksheet
dim curwks as worksheet
dim rngtocopy as range
dim destcell as range

set curwks = worksheets("sheet1")
set newwks = worksheets.add

with curwks
set rngtocopy = .range("a15").entirerow
end with

with newwks
set destcell = .range("a1")
end with

rngtocopy.copy _
destination:=destcell

application.cutcopymode = false

end sub


Grey wrote:
>
> how to copy & paste and Cut & paste data row from one worksheet or another
> one worksheet??
>
> The requirement is I need to create a new worksheet first, and the copy &
> paste or cut & paste a data row from one exist worksheet to the newly
> created worksheet.
>
> because i am a novice in writing VBA in Excel , pls help


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy & paste worksheet with print settings into new worksheet Larry Ohio Microsoft Excel Misc 1 23rd Dec 2009 05:17 PM
my paste icon isn't enabled when i try to copy to anther database. =?Utf-8?B?U1RNTg==?= Microsoft Access 17 16th Mar 2009 05:51 PM
Copy & paste cells fr open worksheet then close the worksheet =?Utf-8?B?U2lu?= Microsoft Excel Programming 1 2nd Oct 2006 02:20 PM
Re: excel 97: copy and paste values from one worksheet to another worksheet JMCN Microsoft Excel Programming 2 23rd Sep 2003 01:32 PM
excel 97: copy and paste values from one worksheet to another worksheet Kathy Microsoft Excel Programming 0 21st Sep 2003 03:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:15 AM.