I have search and cannot find a code or conditional formatting formula that will highlight every other row with multiple columns (A4:BB250) only if the rows contain data.
Does anyone know of a way to do this?
Thank you for your help
I have search and cannot find a code or conditional formatting formula that will highlight every other row with multiple columns (A4:BB250) only if the rows contain data.
Does anyone know of a way to do this?
Thank you for your help
Maybe something like thissub VBAX_SamT() dim r as long dim ColorMe as boolean dim WsF AS object set WsF = application.worksheet.function ColorMe = True 'to start with a highlighted row for r = 4 to 250' or 'To Cells(Rows.Count, "BB").End(xlUp).Row if WsF.Count(Rows.(r)) and ColorMe then ' Count? or CountA? range("A" & r & ":BB" & r). interior.colorIndex = 5 'Adjust color to suit ColorMe = not ColorMe end if next r end sub
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
SamT,
Thank you a quick response.
I get an error when I run the code "Application does not support this property or method" Also, I get an error on this line but they maybe related.
Thank you again for your help
WsF.Count(Rows.(r))ColorMe Then' Count? or CountA?
Just remove dot from this line after worksheet
And also remove dot from this line after rowsSet WsF = application.worksheet.function
If WsF.Count(Rows.(r)) And ColorMe Then ' Count? or CountA?
May be (if you mean to color only the row if all cells in the same row has data)
Sub Test() Dim r As Long Dim WsF As Object Set WsF = Application.WorksheetFunction For r = 4 To 250 If WsF.CountA(Rows(r)) = 54 Then Range("A" & r & ":BB" & r).Interior.ColorIndex = 5 End If Next r End Sub
With Property and Method errors, first, always look at the error line for typos, misspellings, missing or extra dots and other punctuation.I get an error when I run the code "Application does not support this property or method" Also, I get an error on this line
With "A Without B" errors, check for missing and mismatched "End"s and "Next"s in the code around the error line
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Thank you all for your help.