Hello everyone My name is Maurizio and my problem is this: I thought that after all this time of having understood almost everything about vba, but as far as I can see I still lose myself in a glass of water.
So the problem is this: I would like to do what: Whenever I insert any Data in Column (B) that goes from Cell (B6: B35)
"Letters", "Numbers" etc ...!
La Colonna (G) It should be highlighted with the Celeste color
But only logically following the line of the data that I enter in the Column (B) all here!
I tried to put this formula on my own, but it keeps giving me error because and how I can solve this problem always using the VBA.
("X = ActiveCell.Range (" B6: G35 "). Value
If Range ("B" & X & ":: B"). Value = 0 Then
Range ("G6: G"). Interior.Color = RGB (0, 255, 255)
else
Range ("G6: G"). Interior.Color = RGB (242, 242, 242)
Exit Sub
End If ")
Thanks Greetings and Happy Weekend to Everyone by A.Maurizio
Hi Maurizio
Why don't you use a Conditional Formatting?
In the attached I first set the default color for column G to RGB (0,255,255)
I then set the Conditional Formatting that will format the cell in column G if you enter any value (even a 0) in column B (same row) to RGB (242,242,242)
Hope this helps.
Sunny
Hi Maurizio
If you need a macro then try this:
Sub FormatCell()
Dim i As Long
For i = 6 To 35
If Cells(i, 2) <> "" Then
Cells(i, 7).Interior.Color = RGB(0, 255, 255)
Else
Cells(i, 7).Interior.Color = RGB(242, 242, 242)
End If
Next
End Sub
Sunny
Hello SunnyKow as always you are able not only to amaze me with your skill; But also to overcome yourself.
They are both fantastic !!!!!!!!!
Although I always favor the VBA.
And this is fantastic.
Thank you so much and certainly this year I think that no longer have to ask you anything, for here I salute you and thank you so much for your madness; We will feel further for the greetings of happy holidays.
For the moment Thanks Thanks Thanks: Greetings from A.Maurizio
Hi Maurizio
You are welcome and Merry Christmas.
Sunny