I am looking for some help on making a bit of code as I don't know how to do it.
I have cells for these variables: (so they can be easily edited)
ID1: 04e42adab35780 (used for Person1: customer)
ID2: 04944d8a126885 (used for Person2: chief)
...
The code needed would change the ID's from all the data into the persons name (the ones from above) once I click a button
I already have this code to import data from a different file:
Sub RFID_Omzetter() ' ' RFID_Omzetter Macro ' RFID cijfers omzetten naar namen ' ' Sneltoets: Ctrl+d ' ' gegevens kopiëren van een werkblad naar werkblad RFID Omzetter vanaf cel A10 Dim wsCopy As Worksheet Dim wsDest As Worksheet Dim lCopyLastRow As Long Dim lDestLastRow As Long Dim ImporteerNaam As String Dim Badge1 As String, badge2 As String ImporteerNaam = [B3].Value Badge1 = [B5].Value badge2 = [B6].Value '0. Open workbook Workbooks.Open "C:\Users\stagiair\Documents\" & ImporteerNaam & "" Set wsCopy = Workbooks(ImporteerNaam).Worksheets(1) 'The last 1 means the first page of the worksheet Set wsDest = Workbooks("RFID omzetter.xlsm").Worksheets("RFID Omzetter") '1. Find last used row in the copy range based on data in column A lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row '2. Find first blank row in the destination range based on data in column A 'Offset property moves down 1 row lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row '3. Clear contents of existing data range wsDest.Range("A10:G" & lDestLastRow).ClearContents '4. Copy & Paste Data wsCopy.Range("A1:G" & lCopyLastRow).Copy _ wsDest.Range("A10") '5. Close workbook Workbooks(ImporteerNaam).Close SaveChanges:=True End Sub
Bookmarks