I am using the sub below to copy a set of cell values to worksheet "Klantenbestand" in the same workbook. However, I want to store worksheet "Klantenbestand" in a separate workbook. Is it possible to change the sub so that it saves the cell values to worksheet "Klantenbestand" in for instance "book2.xlsm"?
I've got a hunch that a slight change in Sheets() should be the solution...
Sub aanvullen_klantenbestand()
lrij = Sheets("Klantenbestand").Range("B" & Rows.Count).End(xlUp).Row + 1
Sheets("Klantenbestand").Cells(lrij, 2).Value = Sheets("Factuur").Range("G4").Value 'nummer
Sheets("Klantenbestand").Cells(lrij, 3).Value = Sheets("Factuur").Range("G3").Value 'datum
Sheets("Klantenbestand").Cells(lrij, 4).Value = Sheets("Factuur").Range("D3").Value 'naam
Sheets("Klantenbestand").Cells(lrij, 5).Value = Sheets("Factuur").Range("E3").Value 'achternaam
Sheets("Klantenbestand").Cells(lrij, 6).Value = Sheets("Factuur").Range("D4").Value 'bedrijf
Sheets("Klantenbestand").Cells(lrij, 7).Value = Sheets("Factuur").Range("D5").Value 'straat
Sheets("Klantenbestand").Cells(lrij, 8).Value = Sheets("Factuur").Range("D6").Value 'postcode
Sheets("Klantenbestand").Cells(lrij, 9).Value = Sheets("Factuur").Range("E6").Value 'stad
Sheets("Klantenbestand").Cells(lrij, 10).Value = Sheets("Factuur").Range("D7").Value 'telefoon
Sheets("Klantenbestand").Cells(lrij, 11).Value = Sheets("Factuur").Range("E7").Value 'mobiel
Sheets("Klantenbestand").Cells(lrij, 12).Value = Sheets("Factuur").Range("D8").Value 'emailadres
End Sub
Bookmarks