Skip to content

Instantly share code, notes, and snippets.

@benfoley
Created February 26, 2026 00:54
Show Gist options
  • Select an option

  • Save benfoley/4837be80d5dc9f250e27768d2ab3764a to your computer and use it in GitHub Desktop.

Select an option

Save benfoley/4837be80d5dc9f250e27768d2ab3764a to your computer and use it in GitHub Desktop.
Master.xlsm

Put the macro in Master.xlsm

Add a PersonIDs sheet to Files.xlsx workbook

Run the macro after editing person data in Master

Sub CopyColumnToWorkbook()
Application.ScreenUpdating = False
Dim sourceWb As String
Dim targetWb As String
Dim sourceColumn As Range, targetColumn As Range
sourceWb = "Master.xlsm"
targetWb = "Files.xlsx"
Workbooks.Open targetWb
Set sourceColumn = Workbooks(sourceWb).Worksheets("People").Columns("A")
Set targetColumn = Workbooks(targetWb).Worksheets("PersonIDs").Columns("A")
sourceColumn.Copy Destination:=targetColumn
Workbooks(targetWb).Close SaveChanges:=True
Application.ScreenUpdating = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment