Combine sheets - different size n shape

Closed
carman - Aug 4, 2010 at 02:31 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Aug 5, 2010 at 07:37 AM
Hello,
i need help to combine two sheets in the same document by VBA scripts. My 2 worksheets have very similar format (same column numbers, same headings but the cells got different size and shapes).
I want to copy the data from sheet 5 to sheet 1, where the data obtained from sheet 5 should be placed right behind the data of sheet 1. The problem i came across is that since the cells got different shapes and size, excel could not do the copy and paste for me using vba scripts.

please take a look at the reference file.
https://authentification.site/files/23654475/hoho.xls

I want to add the data in sheet 5 to sheet 1(after the last filled row in sheet 1). sheet 3 is my target, but i would like the real output to be placed in sheet 1.


Also, please find macro 1 in the file, which is the scripts i used to perform the job. i did a similar job before (when all the cells got same size and shape), the codes work, but not this time...

Please help. Thanks


Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 4, 2010 at 08:40 AM
Copy what range to what range? by range i mean copy what columns to what column
0
Copy range E to AK from sheet 5( without the headings -row 1 & 2) and paste the data right below the last row of data in sheet 1(also, range E to AK) . Thanks
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 5, 2010 at 07:37 AM
Change this part of your macro
If (lTgtLastRow = 1) Then
Rows("1:" & lSrcMaxRows).Copy
Else
Rows("2:" & lSrcMaxRows).Copy
End If

Make it to copy the range that you would like to copy. This copy the rows

And change this Cells(lTgtLastRow, "A").PasteSpecial
This start pasting at column A. Change it to E
0