File consolidation

  • Thread starter Thread starter Jonl
  • Start date Start date
J

Jonl

I have two excel files with workbooks laid out identically. Th
wookbooks list all employess in column A and then all days of the year
Employees access the file and highlight a day in yellow if they want i
off. Unfortunatly two files were set up for the same purpose. I onl
want one but employess have been using both. I want to consolidat
these files. I basically want to import all the highlights from one t
the other. I imagine a macro is in order
 
Jonl,

Open both workbooks, and run code like this, after changing the file names and sheet names to suit:
This assumes that the default color fill is none.

Sub JonlMacro()
Dim myCell As Range
Windows("Book2.xls").Activate
For Each myCell In ActiveSheet.UsedRange
If myCell.Interior.ColorIndex <> xlNone Then
Workbooks("Book1.xls").Worksheets("Sheetname") _
.Range(myCell.Address).Interior.ColorIndex = _
myCell.Interior.ColorIndex
End If
Next myCell
End Sub
HTH,
Bernie
MS Excel MVP
 
Back
Top