L
Legacy 436357
Guest
Hello,
Is there a way to alter this code to post the font, font size, and font color to the destination sheets?
What I mean is to maintain the individual cells from the source sheets.
Thank you very much for your help,
XJ
</code>
Is there a way to alter this code to post the font, font size, and font color to the destination sheets?
What I mean is to maintain the individual cells from the source sheets.
Thank you very much for your help,
XJ
Code:
<code>Sub AddEventsToSheets()
Call ClearCells
Dim ws As Worksheet, sh As Worksheet
Dim Rng As Range, c As Range, fNd As Range
Dim NrNg As Range, g As Range, m As String
For Each ws In Sheets(Array("Holidays", "Events"))
With ws
Set Rng = .Range("A3:A" & .Cells(.Rows.Count, "A").End(xlUp).Row)
For Each c In Rng.Cells
m = Format(c, "MMMM")
Set NrNg = Sheets(m).Range("A3:N33").SpecialCells(xlCellTypeFormulas, 23)
For Each g In NrNg
If g.Value = c.Value Then
g.Resize(6).SpecialCells(xlBlanks)(1).Value = c.Offset(, 1)
End If
Next g
Next c
Set Rng = .Range("H3:H" & .Cells(.Rows.Count, "H").End(xlUp).Row)
For Each c In Rng.Cells
If Month(c) = 1 Then
m = "december"
Set NrNg = Sheets(m).Range("A3:N33").SpecialCells(xlCellTypeFormulas, 23)
For Each g In NrNg
If g.Value = c.Value Then
g.Resize(6).SpecialCells(xlBlanks)(1).Value = c.Offset(, 1)
End If
Next g
End If
Next c
End With
Next ws
End Sub
Last edited by a moderator: