Problem moving records to another worksheet

[Solved/Closed]
Report
-
 MIKE -
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 replies

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
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
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
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
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