r_mundhra
08-14-2010, 04:06 AM
Hi Experts out there:
Problem: Matching of Font Colour Index with Cell Interior Color Index thru VBA using Input box to maintain flexibility. Say in an xl worksheet there are different cells (conatining numbers)filled with different colors and one of the colours filled in is red. With the help of macro I want to change color of the fonts (in the red cells in our eg) to red, so that those numbers become invisible.
I hv written this macro..but is not working ....can anyone help on this.
Sub FontColorChange()
Answer = InputBox(Prompt:="Here you are being provided with an option to decide the Font Colour" & vbCrLf & vbCrLf & vbCrLf & "Input the Font Colour Code You want", Title:="Rajesh Says:")
For Each x In Selection
On Error Resume Next
If x.Interior.ColorIndex = Answer Then
x.Font.ColorIndex = Answer
End If
Next x
End Sub
Thanx in anticipation.
Problem: Matching of Font Colour Index with Cell Interior Color Index thru VBA using Input box to maintain flexibility. Say in an xl worksheet there are different cells (conatining numbers)filled with different colors and one of the colours filled in is red. With the help of macro I want to change color of the fonts (in the red cells in our eg) to red, so that those numbers become invisible.
I hv written this macro..but is not working ....can anyone help on this.
Sub FontColorChange()
Answer = InputBox(Prompt:="Here you are being provided with an option to decide the Font Colour" & vbCrLf & vbCrLf & vbCrLf & "Input the Font Colour Code You want", Title:="Rajesh Says:")
For Each x In Selection
On Error Resume Next
If x.Interior.ColorIndex = Answer Then
x.Font.ColorIndex = Answer
End If
Next x
End Sub
Thanx in anticipation.