View Single Post
 
Old 04-12-2025, 06:46 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default

This is my macro:


Code:
Sub ColorRGBText()
OPT = InputBox("Get Color[1], Apply Color[2]", "Color Management", "1")
If OPT = 1 Then
'MsgBox Selection.Font.TextColor.RGB
MyColor = Selection.Font.TextColor.RGB 'gets the color
Dim MyData As DataObject: Set MyData = New DataObject
MyData.SetText MyColor: MyData.PutInClipboard 'copies color code into ClBrd
End If
'When the macro is restarted and option 2 selected, the color code should be applied to a different text selection
If OPT = 2 Then Selection.Font.TextColor.RGB = MyColor 
End Sub
Reply With Quote