ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quick question..:P (Row range) (https://www.excelbanter.com/excel-programming/365109-quick-question-p-row-range.html)

Turquoise_dax[_20_]

Quick question..:P (Row range)
 

Dim cell As Range
For Each cell In Range("B:B")
If Len(cell.Value) = 0 Then cell.Offset(0, 1).Interior.Pattern
xlPatternGray8
Next


How can I set this code so Excel doesn't apply this setting up to th
65 000th line? (max

--
Turquoise_da
-----------------------------------------------------------------------
Turquoise_dax's Profile: http://www.excelforum.com/member.php...fo&userid=3518
View this thread: http://www.excelforum.com/showthread.php?threadid=55466


darpan_mirror

Quick question..:P (Row range)
 

If you don't want to apply the format beyond row 65000, I think this
should work for you.

Sub test()
Dim cell As Range
For Each cell In Range("B1:B65000")
If Len(cell.Value) = 0 Then cell.Offset(0, 1).Interior.Pattern =
xlPatternGray8
Next
End Sub


--
darpan_mirror
------------------------------------------------------------------------
darpan_mirror's Profile: http://www.excelforum.com/member.php...o&userid=35593
View this thread: http://www.excelforum.com/showthread...hreadid=554663



All times are GMT +1. The time now is 06:16 PM.

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