J
JCO
I have many workbooks and sheets that I need to remove the hyperlinks from.
When doing the code below, it removes all formatting.
Sub RemoveHyperlinks()
Selection.Hyperlinks().Delete
End Sub
The issue is that it changes all the fonts boarders and many of the cells
have different color background shadings (fill). So I turned the "Record
Macro" on and was able to modify the Macro by reapplying the font name, font
size, font color, cell boarders.
Sub RemoveHyperlinksOnly()
Selection.Hyperlinks().Delete
' Set new font name
--code--
' Set new font size
--code--
' Set new font color
--code--
' Set boarders
--code--
End Sub
However, the "Format Cell>Fill>Color" of many cells are Green, Red, Yellow &
Pink
I know I can use format painter and do these separately but I have many of
these to do on an ongoing basis. The Excel Workbooks are given to me so I
have to make the changes to 8-12 sheets out of 15 sheets total. I need a
way to add to my existing macro to take a cell and do the following:
Sub RemoveHyperlinksOnly()
1 store existing "Format Cell>Fill>Color" in a variable
2 do my existing macro
3 change "Format Cell>Fill>Color" to the variable that was stored
End Sub
Any help is appreciated. I suspect it is easy to do but I don't deal with
macros much.
When doing the code below, it removes all formatting.
Sub RemoveHyperlinks()
Selection.Hyperlinks().Delete
End Sub
The issue is that it changes all the fonts boarders and many of the cells
have different color background shadings (fill). So I turned the "Record
Macro" on and was able to modify the Macro by reapplying the font name, font
size, font color, cell boarders.
Sub RemoveHyperlinksOnly()
Selection.Hyperlinks().Delete
' Set new font name
--code--
' Set new font size
--code--
' Set new font color
--code--
' Set boarders
--code--
End Sub
However, the "Format Cell>Fill>Color" of many cells are Green, Red, Yellow &
Pink
I know I can use format painter and do these separately but I have many of
these to do on an ongoing basis. The Excel Workbooks are given to me so I
have to make the changes to 8-12 sheets out of 15 sheets total. I need a
way to add to my existing macro to take a cell and do the following:
Sub RemoveHyperlinksOnly()
1 store existing "Format Cell>Fill>Color" in a variable
2 do my existing macro
3 change "Format Cell>Fill>Color" to the variable that was stored
End Sub
Any help is appreciated. I suspect it is easy to do but I don't deal with
macros much.