How to do when the Cell is in color jump to next cell?

J

jean

Hi,
I have a worksheet with some column in blue color background & when i enter
the data in this worksheet (direction Right when I press the ENTER key) I
would like if the next column is in blue the cursor automaticly jump to the
next column until the cell have no background color.
It is Possible?
Thank you very much

Jean
 
R

Rick Rothstein \(MVP - VB\)

I guess you could use SelectionChange event code something like this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Interior.ColorIndex = 41 And _
Target.Column < Columns.Count And Target.Count = 1 Then
Target.Offset(0, 1).Select
End If
End Sub

Change the number 41 I used above to the ColorIndex value for your
particular Blue color.

Rick
 
J

jean

Thank you very much.
I copy that in my sheets after changing the number of the colorindex & it
work beautifully.
Thank you again.
Jean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top