I use this code to copy the formatting from a template row and apply it to a range on my main sheet:
I'm trying to achieve the same result without using the copy/paste. Something like this:
The "Hyperlinks" range is a single row whereas the "CalendarAllColumns" is many. Copying and pasting just the formatting works but I want to do it without.
VBA Code:
Sub DeleteFormatting()
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.GoTo Reference:="CalendarHyperlinks"
With Selection.FormatConditions.Delete
End With
Sheets("Template").Activate
Range("Hyperlinks").Select
Selection.Copy
Sheets("Calendar").Activate
Range("CalendarAllColumns").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I'm trying to achieve the same result without using the copy/paste. Something like this:
VBA Code:
Sub DeleteFormatting()
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.GoTo Reference:="CalendarHyperlinks"
With Selection.FormatConditions.Delete
End With
Sheets("Calendar").Range("CalendarAllColumns") = Sheets("Template").Range("Hyperlinks")
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
The "Hyperlinks" range is a single row whereas the "CalendarAllColumns" is many. Copying and pasting just the formatting works but I want to do it without.