Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default More efficient copy/paste??


TIA!!!

Is there a more efficient way to perform this copy paste? I know yo
should always avoid selecting if possible. I have tried a number o
things and had no success. Here is the snippet of code I want t
streamline:

If rngNHO Is Nothing Then GoTo skipNHO
Sheets("ALL").Select
rngNHO.Copy
Sheets("Contribs").Select
Cells(Range("A3").End(xlDown).Row + 1, "A").Select
ActiveSheet.Paste
skipNHO:

I have several snippets like this in my macro. Any help is greatl
appreciated!

--
Cel
-----------------------------------------------------------------------
Celt's Profile: http://www.excelforum.com/member.php...fo&userid=1941
View this thread: http://www.excelforum.com/showthread.php?threadid=55039

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default More efficient copy/paste??

Set rngNHO = Sheets("All").Range("A1")
Cells(Range("A3").End(xlDown).Row + 1, "A").Select
rngNHO.Copy ActiveCell

This assumes that you are on the Sheet that you want to paste the data
into.

HTH

Die_Another_Day

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default More efficient copy/paste??


Thanks guys!

Quick question Ardus...

With your code, if rngNHO is nothing...will that cause an error

--
Cel
-----------------------------------------------------------------------
Celt's Profile: http://www.excelforum.com/member.php...fo&userid=1941
View this thread: http://www.excelforum.com/showthread.php?threadid=55039

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default More efficient copy/paste??

if you don't set the rngNHO to some range then it is empty...

Die_Another_Day

Celt wrote:
Thanks guys!

Quick question Ardus...

With your code, if rngNHO is nothing...will that cause an error?


--
Celt
------------------------------------------------------------------------
Celt's Profile: http://www.excelforum.com/member.php...o&userid=19413
View this thread: http://www.excelforum.com/showthread...hreadid=550393




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default More efficient copy/paste??

for Ardus' code it should not because of the if not rngNHO = Nothing

HTH

Die_Another_Day
Celt wrote:
Thanks guys!

Quick question Ardus...

With your code, if rngNHO is nothing...will that cause an error?


--
Celt
------------------------------------------------------------------------
Celt's Profile: http://www.excelforum.com/member.php...o&userid=19413
View this thread: http://www.excelforum.com/showthread...hreadid=550393


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
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Efficient way to copy a range in numerous sheets within a workbook Steve O Excel Programming 2 September 15th 05 01:58 AM
Efficient Copy/Paste William Benson[_2_] Excel Programming 4 September 8th 05 07:42 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
More efficient method to copy-paste values in place? quartz[_2_] Excel Programming 4 November 15th 04 01:54 PM


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

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"