Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filtered Mode Copying and pasting as value yield as error? | Excel Discussion (Misc queries) | |||
VALUE error after pasting html banking data | Excel Discussion (Misc queries) | |||
Error in Code - Pasting Values | Excel Programming | |||
Excel 1004 Error When Pasting Special W/ Macro | Excel Discussion (Misc queries) | |||
Error in Copying and pasting data | Excel Programming |