Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pasting Error


hI:

I'm getting an error with this code because Copy Area and Paste Area
are not same size. The Copy Area is the same column but I never know
how many cells it is going to have. The Paste Area is right below the
last cell that contains data in a different column. Any help is
welcome.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
Range("DS5").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
'
Range("A5").Select
Do
If ActiveCell.Select < "" Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
'
ActiveSheet.Paste


thanks


--
halem2
------------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=502069

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Pasting Error

Hi,
Try thiS;

' find next blank row in column A
nextrow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Range("d5").Select
Range("d5").Resize(ActiveCell.End(xlDown)).Copy Range("a" & nextrow)

"halem2" wrote:


hI:

I'm getting an error with this code because Copy Area and Paste Area
are not same size. The Copy Area is the same column but I never know
how many cells it is going to have. The Paste Area is right below the
last cell that contains data in a different column. Any help is
welcome.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
Range("DS5").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
'
Range("A5").Select
Do
If ActiveCell.Select < "" Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
'
ActiveSheet.Paste


thanks


--
halem2
------------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=502069


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Pasting Error

Sorry , last post should say DS5 not D5!

"halem2" wrote:


hI:

I'm getting an error with this code because Copy Area and Paste Area
are not same size. The Copy Area is the same column but I never know
how many cells it is going to have. The Paste Area is right below the
last cell that contains data in a different column. Any help is
welcome.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
Range("DS5").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
'
Range("A5").Select
Do
If ActiveCell.Select < "" Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
'
ActiveSheet.Paste


thanks


--
halem2
------------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=502069


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pasting Error


thanks a lot for the help. Truly appreciate it. :)


--
halem2
------------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=502069

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
Filtered Mode Copying and pasting as value yield as error? aligahk06 Excel Discussion (Misc queries) 1 March 15th 10 03:30 PM
VALUE error after pasting html banking data exceluser Excel Discussion (Misc queries) 3 December 20th 08 01:34 AM
Error in Code - Pasting Values Janet H[_2_] Excel Programming 5 September 1st 05 09:35 PM
Excel 1004 Error When Pasting Special W/ Macro setoFairfax Excel Discussion (Misc queries) 2 April 27th 05 02:28 PM
Error in Copying and pasting data Shilps[_2_] Excel Programming 3 October 1st 04 12:47 PM


All times are GMT +1. The time now is 09:17 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"