ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find empty row and color (https://www.excelbanter.com/excel-programming/385252-find-empty-row-color.html)

SITCFanTN

Find empty row and color
 
I've searched previous posts and can't find how to locate the first empty row
between text and color it black between Col A through H. Any help you can
give is appreciated, thank yoiu

[email protected]

Find empty row and color
 
Dim myRange as Range
Dim myRangeData as Variant
Dim myRows as long, myColumns as long, i as long, j as long

Application.Screenupdating = False
myRange = Activesheet.Range(whatever it is)
myRangeData = Activesheet.Range(whatever it is).Value
myRows = UBound(myRangeData,1)
myColumns = UBound(myRangeData,2)

For i = 1 to myRows
TempString = ""
For j = 1 to myColumns
TempString = TempString & myRangeData(i,,j)
next j
TempString = Trim(TempString)
If TempString = "" then
myRange.Rows(i).Interior.Colorindex = 1
end if
next i

regards
Paul


On Mar 14, 2:02 pm, SITCFanTN
wrote:
I've searched previous posts and can't find how to locate the first empty row
between text and color it black between Col A through H. Any help you can
give is appreciated, thank yoiu




Tom Ogilvy

Find empty row and color
 
without knowing more about the layout of your data, I can only guess, but

cells(2,1).End(xldown)(2).Resize(1,8).Interior.col orIndex = 1

assumes the first empty row will be beyond row 3 and that column A can be
used to discover this row.

--
Regards,
Tom Ogilvy


"SITCFanTN" wrote:

I've searched previous posts and can't find how to locate the first empty row
between text and color it black between Col A through H. Any help you can
give is appreciated, thank yoiu



All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com