G
Gonçalo Duarte
Hi!
I have various worksheets and I want to reference some cells and have the cell to have the original format (bold, color and pattern).
So for example A1=FEV12!A1, and A1 having the FEV12!A1's format, and updating everytime FEV12!A1's format changes.
I was reading a lot about it and came up with this sub, but it isn't working...
Sub FormatOfAssignment()
Dim rng As Range, cell As Range
Set rng = Selection
For Each cell In Intersect(rng, _
rng.SpecialCells(xlFormulas))
On Error GoTo passby
Range(Mid(cell.Formula, 2)).Copy
cell.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
passby:
On Error GoTo 0
Next cell
End Sub
Can anyone help me out?
Thanks so much in advance!
I have various worksheets and I want to reference some cells and have the cell to have the original format (bold, color and pattern).
So for example A1=FEV12!A1, and A1 having the FEV12!A1's format, and updating everytime FEV12!A1's format changes.
I was reading a lot about it and came up with this sub, but it isn't working...
Sub FormatOfAssignment()
Dim rng As Range, cell As Range
Set rng = Selection
For Each cell In Intersect(rng, _
rng.SpecialCells(xlFormulas))
On Error GoTo passby
Range(Mid(cell.Formula, 2)).Copy
cell.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
passby:
On Error GoTo 0
Next cell
End Sub
Can anyone help me out?
Thanks so much in advance!