How to color a row?

  • Thread starter Thread starter Henrootje
  • Start date Start date
H

Henrootje

Hello,

using the code

Dim ArtVolgnummer As String
Dim NieuwArtikelNr As String

ProduktCode = InputBox("Geef de produktsoort op" & Chr(10) & Chr(10) &
"HardWare = hw" & Chr(10) & "SoftWare = sw", "Produktsoort")
Artikelvolgnummer = InputBox("Geef het nieuwe artikelnummer op" &
Chr(10) & Chr(10) & "9999", "Artikelnummer")
NieuwArtikelNr = ProduktCode & Artikelvolgnummer

Sheets("hoofdblad").Select
Range("A1").End(xlDown).Offset(1, 0).Formula = NieuwArtikelNr

I fill a cell on a worksheet with a value that looks like sw9999 or
hw9999

Now I would like yhat whole ROW to turn yellow if SW is found in the
NieuwArtikelNr or ProduktCode.

How would one do that?

Thnx for thinking!

Grtz Henro
 
Henro,

Use conditional formatting with a formula of

=COUNTIF(1:1,"*SW*)

and set the colour to yello.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
That does not work??????? It says there is an error in the formula?
And I have to select conditional formatting on all the fields in the
sheet right??

(Sorry, used to access, not excel)

TIA Henro
 
By adding this code I get the first field (A) to colour yellow so I
guess I am getting close...............

Sheets("hoofdblad").Select
Range("A1").End(xlDown).Offset(1, 0).Formula = NieuwArtikelNr
If ProduktCode = "sw" Then
Range("A1:J1").End(xlDown).Offset(0, 0).Interior.ColorIndex =
6
End If

Now, how do I extend this to the whole row?

TIA Henro
 
Try again

=COUNTIF(1:1,"*SW*")>0

or

=AANTAL.ALS(1:1;"*SW*")>0

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top