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

I have had a persistant problem that will just not go away. And I have
the boss breathing down my neck. So any help will be greatly
appreciated. I have had a macro that was working for months then
stopped working. Below is some of the code.

The goal of the macro is to open up spreadsheets and then append the
data to the next available blank cell so that the users data is all in
one spreadsheet.

Some of Code :

While Len(lcTheSource) 0
lcFileName = lcPath & "\" & lcTheSource

Workbooks.Open FileName:=lcFileName
Set wb = ActiveWorkbook

Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=41, Criteria1:="FB"
Range("A1").Select
Set rngSource =
ActiveSheet.Cells.SpecialCells(xlCellTypeVisible)
wbNew.Activate
Range("A1").Select
If Len(Trim(ActiveCell.Value)) 0 Then
lnLastRow = ActiveSheet.UsedRange.Rows.Count + 1
Else
lnLastRow = 1
End If
lcCell = "A" & Trim(CStr(lnLastRow)) & ""
Range(lcCell).Select
Set rngDestination = ActiveSheet.Range(lcCell)
rngSource.Copy rngDestination < --- Crashes here.

The above code works on the first run but then I get an error that
says :

Run-Time error '1004'

The information cannot be pasted because the Copy area and the paste
area are not the same size and shape. Try one of the following:

1.) Click a single cell, and then past
2.) Select a rectangle that's the same size and shape, and then paste.

I did 1 and 2. Nothing worked. How else can I do the task above.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Paste Problem

Important question: How many rows are filled in on the destination sheet, and
how many are you trying to append? One explanation for this would be if you
are near the maximum allowed rows (65536). For example: if you are at 65000
rows and you are trying to paste in 550 rows. All you would have room for is
536 rows, so "the copy area and the paste area are not the same size and
shape." (Copy area = 550 rows, paste area = 536).

Afraid no easy solution to this if it is so, since you have hit a design
limit of Excel.
K Dales

"Rich" wrote:

I have had a persistant problem that will just not go away. And I have
the boss breathing down my neck. So any help will be greatly
appreciated. I have had a macro that was working for months then
stopped working. Below is some of the code.

The goal of the macro is to open up spreadsheets and then append the
data to the next available blank cell so that the users data is all in
one spreadsheet.

Some of Code :

While Len(lcTheSource) 0
lcFileName = lcPath & "\" & lcTheSource

Workbooks.Open FileName:=lcFileName
Set wb = ActiveWorkbook

Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=41, Criteria1:="FB"
Range("A1").Select
Set rngSource =
ActiveSheet.Cells.SpecialCells(xlCellTypeVisible)
wbNew.Activate
Range("A1").Select
If Len(Trim(ActiveCell.Value)) 0 Then
lnLastRow = ActiveSheet.UsedRange.Rows.Count + 1
Else
lnLastRow = 1
End If
lcCell = "A" & Trim(CStr(lnLastRow)) & ""
Range(lcCell).Select
Set rngDestination = ActiveSheet.Range(lcCell)
rngSource.Copy rngDestination < --- Crashes here.

The above code works on the first run but then I get an error that
says :

Run-Time error '1004'

The information cannot be pasted because the Copy area and the paste
area are not the same size and shape. Try one of the following:

1.) Click a single cell, and then past
2.) Select a rectangle that's the same size and shape, and then paste.

I did 1 and 2. Nothing worked. How else can I do the task above.

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 Problem Between Ex 97 vs 2k DaveM Excel Discussion (Misc queries) 5 January 30th 08 02:31 PM
Paste problem Pietro Excel Discussion (Misc queries) 2 October 13th 07 06:14 PM
Paste Problem Ed Excel Discussion (Misc queries) 1 January 5th 06 10:42 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
CUT & PASTE PROBLEM Todd Excel Discussion (Misc queries) 1 March 10th 05 12:45 AM


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