Problem moving records to another worksheet

Solved/Closed
Mike - Jul 11, 2010 at 02:51 AM
 MIKE - Jul 15, 2010 at 02:20 PM
Hello eberybody

I have a doubt, I know how to move records from one sheet to another, as this:

Worksheets("Sheet1").Range("A" & i + 2).Resize(1, 6).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)

but how to do it if I want to to move the records to another workbook in the sheet2. Also the name of the first file is MIke1 and the ile I want to transfer is Mike2. Iam not an expert if you can help with the code I will appreciated.

Thanks




6 responses

Sorry, I meant moving records to another worbook not another worksheet.

Worksheets("Sheet1").Range("A" & i + 2).Resize(1, 6).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)

but how to do it if I want to to move the records to another workbook in the sheet2. Also the name of the first file is MIke1 and the file I want to transfer is Mike2. Iam not an expert if you can help with the code I will appreciated.
I would appreciate any help you ca give me with this problem:

How can I do if I want to to move the records from file called MIke1 to another file, MIke2 in the sheet2. Iam not an expert if you can help with the code I will appreciated.

Worksheets("Sheet1").Range("A" & i + 2).Resize(1, 6).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)

Thanks
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jul 13, 2010 at 08:15 AM
easiest way would to to copy the range

activate the other workbook
select the sheet on the other worbook
paste the data
and activate back the original book
Hi Iam not an expert it seems like you know this, could you give a hand man with a code to do this, Iam getting crazy please!!!

I was looking the questions of other people, how would you do by code to move the values or records from the next line

Sheets(sheet1).Cells(lLastRow, "A") = ListBox1.List(iListCount, 0)


located in a file called mike1 to a file called mike2

Anything you do for me I would appreciate it
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jul 14, 2010 at 05:59 PM
Some thing like this. You can have a good idea if you use macro recorder and record your actions

Dim WB1 as workbook
Dim Wb2 as workbook

Set WB1 = Workbook("Book1.xls")
Set WB2 = Workbook("Book2.xls")

WB1.Activate
Sheets("Sheet1").Select
Range("A" & i + 2).Resize(1, 6).Copy

WB2.Activate
Sheets(("Sheet2").select
Range("A" & Rows.Count).End(xlUp).Offset(2).select
activecell.PasteSpecial xlpasteall

Wb1.activate
tHANKS MAN THIS IS WHAT i NEEDED