Sub ChangeShapeColor() Dim shp As Shape Dim currentColor As Long Dim newColor As Long Dim userInput As String ' ¼±ÅÃµÈ µµÇüÀ» °¡Á®¿È On Error Resume Next Set shp = ActiveWindow.Selection.ShapeRange(1) On Error GoTo 0 ' ¼±ÅÃµÈ µµÇüÀÌ ¾øÀ¸¸é ¸Þ½ÃÁö Ç¥½Ã If shp Is Nothing Then MsgBox "µµÇüÀ» ¼±ÅÃÇϼ¼¿ä.", vbExclamation Exit Sub End If ' ÇöÀç »ö»ó ÄÚµå °¡Á®¿À±â currentColor = shp.Fill.ForeColor.RGB ' ÀÔ·Â ¹Ú½º ±¸¼º (ÇÑ ÁÙ ÀÔ·Â) userInput = InputBox("ÇöÀç »ö»ó ÄÚµå: #" & Right("000000" & Hex(currentColor), 6) & vbCrLf & _ "º¯°æÇÒ »ö»ó ÄÚµå (6ÀÚ¸®, ¿¹: 123ABC):", "»ö»ó º¯°æ") ' ÀԷ°ª À¯È¿¼º °Ë»ç If Len(userInput) <> 6 Or Not IsHex(userInput) Then MsgBox "¿Ã¹Ù¸¥ 6ÀÚ¸® »ö»ó Äڵ带 ÀÔ·ÂÇϼ¼¿ä.", vbExclamation Exit Sub End If ' »ö»ó º¯°æ newColor = RGB(CByte("&H" & Left(userInput, 2)), _ CByte("&H" & Mid(userInput, 3, 2)), _ CByte("&H" & Right(userInput, 2))) On Error Resume Next ' ¸ðµç µµÇü »ö»ó º¯°æ Dim sld As Slide Dim s As Shape For Each sld In ActivePresentation.Slides For Each s In sld.Shapes If s.Fill.ForeColor.RGB = currentColor Then s.Fill.ForeColor.RGB = newColor End If Next s Next sld On Error GoTo 0 MsgBox "»ö»óÀÌ º¯°æµÇ¾ú½À´Ï´Ù.", vbInformation End Sub Function IsHex(value As String) As Boolean Dim i As Integer IsHex = True For i = 1 To Len(value) Select Case Mid(value, i, 1) Case "0" To "9", "A" To "F", "a" To "f" ' Do nothing, valid character Case Else IsHex = False Exit Function End Select Next i End Function