i need a colour platte on each within a range of cells is there an add-in for this?
i need a colour platte on each within a range of cells is there an add-in for this?
how can i right click on an active cell and change the font color of the cell's content without clicking format cells?
You don't need to right click on the cell to change the interior or font color.Originally Posted by josephm
If you look along your excel toolbar you will see a button for Font Colour and a button for interior color, just click on these and select the color. If you don't see these buttons, right click in your toolbar area click customize, then drag and drop the buttons you need to add
Marshybid
thank you but i do want the user to have to go all the way up there
isnt there a add-in similar to the pop-up calander?
This will toggle the Font between xlAutomatic and Red with a Right Click
I think it best to use a BeforeDoubleClick instead. This maintains your Right Click MenuPrivate Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Target.Font.ColorIndex = xlAutomatic Then Target.Font.ColorIndex = 3 Else: Target.Font.ColorIndex = xlAutomatic End If Cancel = True End Sub
lenze
i want the user to pick either red or green. how do i do that using the above code.?
and from the right click menu how does the user select red or green?
I don't understand your question? Can you give an example of your needs?
lenze
[VBA]Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Font.ColorIndex = xlAutomatic Then
Target.Font.ColorIndex = 3
Target.Font.ColorIndex = 4
Else: Target.Font.ColorIndex = xlAutomatic
End If
Cancel = True
End Sub[/VBA]
i made a change to the code as shown above but then it only toggles between XLautomatic and green it leave out the red.
i want it to toggle beteen automatic, red and green.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean If Target.Font.ColorIndex = 4 Then Target.Font.ColorIndex = 3 Else: Target.Font.ColorIndex = 4 End If Cancel = True End Sub
You just need to change to the appropriate ColorIndex Number. To see all the CI's on your computer, place this code in a regular modue and run it on a blank sheet
lenzeSub ShowColorIndex() Dim cl As Range Dim x As Integer x = 0 Range("$A$3:$A$17").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .ColumnWidth = 17.5 .RowHeight = 20 .Font.Bold = True End With For Each cl In Selection cl.Value = x cl.Interior.ColorIndex = x x = x + 1 Next cl Range("$C$4:$C$17").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .ColumnWidth = 17.5 .Font.Bold = True End With For Each cl In Selection cl.Value = x cl.Interior.ColorIndex = x x = x + 1 Next cl Range("$E$4:$E$17").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .ColumnWidth = 17.5 .Font.Bold = True End With For Each cl In Selection cl.Value = x cl.Interior.ColorIndex = x x = x + 1 Next cl Range("$G$4:$G$17").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .ColumnWidth = 17.5 .Font.Bold = True End With For Each cl In Selection cl.Value = x cl.Interior.ColorIndex = x x = x + 1 Next cl Range("$D$1").Select Selection = "COLORINDEX" Selection.Font.Bold = True Selection.HorizontalAlignment = xlCenter Selection.ColumnWidth = 17.5 End Sub
If you want to toggle between xlAutomatic, Red, And Green, try this
lenzePrivate Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Font.ColorIndex = 4 Then Target.Font.ColorIndex = 3 Cancel = True Exit Sub End If If Target.Font.ColorIndex = 3 Then Target.Font.ColorIndex = xlAutomatic Cancel = True Exit Sub End If Target.Font.ColorIndex = 4 Cancel = True End Sub
This will also work
[vba]
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Font.ColorIndex = 4 Then
Target.Font.ColorIndex = 3
Cancel = True
ELSEIF Target.Font.ColorIndex = 3 Then
Target.Font.ColorIndex = xlAutomatic
Cancel = True
ELSEIF Target.Font.ColorIndex = xlAutomatic Then
Target.Font.ColorIndex = 4
Cancel = True
End If
End Sub
[/vba]
[vba]
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Application.Dialogs(xlDialogPatterns).Show
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
[/vba]
This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
See my post in your other thread.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Joseph,
Why do you guys insist on taking the Bart Simpson approach to asking questions? Asking the same question in mutiple threads only turns people away from helping you. I have merged your identical thread questions and in the future please stick to one question/one thread.
How would you feel if you spent the time to research and respond to someone's question only to find out that they had posted the same question in a different thread and already had an answer.....you would probably not want to help them in the future would you?
Please be considerate of our contributors.....you are not the only one with a question and your question is darn sure not more important than everyone elses......
We like to run a friendly board here so we will insist that you behave and be courtious and gratious when you do receive the help you are here asking for.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln