ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   empty rows in range (https://www.excelbanter.com/excel-programming/349625-empty-rows-range.html)

רוזנט

empty rows in range
 
i want a code like this

if any row (part of row) in range XX is empty then
do yy....

thank you
rozent

Dave Peterson

empty rows in range
 
Dim myRng as range
dim myRow as range
dim delRng as range

set myrng = activesheet.range("a1:x99")

for each myrow in myrng.rows
if application.counta(myrow) < myrow.cells.count then
'at least one really empty cell.
'do what you want
'if you're deleting
if delrng is nothing then
set delrng = myrow.cells(1)
else
set delrng = union(delrng,myrow.cells(1))
end if
end if
next myrow

if delrng is nothing then
'do nothing
else
delrng.entirerow.delete
end if

????? wrote:

i want a code like this

if any row (part of row) in range XX is empty then
do yy....

thank you
rozent


--

Dave Peterson


All times are GMT +1. The time now is 02:59 AM.

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