ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   To find row is empty or not (https://www.excelbanter.com/excel-discussion-misc-queries/238081-find-row-empty-not.html)

pol

To find row is empty or not
 
Hi all,

I kindly request your help how to find a row is empty row. For example in
my following code I have to give one more condition also like



if rowcount = currow and rowcount is not empty // How I can give the
condition

Original code as follows

LastRow = Range("G" & Rows.Count).End(xlUp).Row
currow = ActiveCell.Row

For RowCount = 1 To LastRow
If RowCount = currow Then // I need to check row is empty or not
If Range("A" & RowCount) = "" Or Range("A" & RowCount) = 0 Then
Range("A" & RowCount) = Col_A
Else
Col_A = Range("A" & RowCount)
End If
end if
Next

With thanks
Pol

joel

To find row is empty or not
 

countnonblanks = Application.WorksheetFunction.CountA(Rows(2))
If countnonblanks 0 Then

End If

"pol" wrote:

Hi all,

I kindly request your help how to find a row is empty row. For example in
my following code I have to give one more condition also like



if rowcount = currow and rowcount is not empty // How I can give the
condition

Original code as follows

LastRow = Range("G" & Rows.Count).End(xlUp).Row
currow = ActiveCell.Row

For RowCount = 1 To LastRow
If RowCount = currow Then // I need to check row is empty or not
If Range("A" & RowCount) = "" Or Range("A" & RowCount) = 0 Then
Range("A" & RowCount) = Col_A
Else
Col_A = Range("A" & RowCount)
End If
end if
Next

With thanks
Pol


Luke M

To find row is empty or not
 
Perhaps something like:

If RowCount = currow And _
WorksheetFunction.CountA(Cells(RowCount, 1).EntireRow) 0 Then
'...etc.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"pol" wrote:

Hi all,

I kindly request your help how to find a row is empty row. For example in
my following code I have to give one more condition also like



if rowcount = currow and rowcount is not empty // How I can give the
condition

Original code as follows

LastRow = Range("G" & Rows.Count).End(xlUp).Row
currow = ActiveCell.Row

For RowCount = 1 To LastRow
If RowCount = currow Then // I need to check row is empty or not
If Range("A" & RowCount) = "" Or Range("A" & RowCount) = 0 Then
Range("A" & RowCount) = Col_A
Else
Col_A = Range("A" & RowCount)
End If
end if
Next

With thanks
Pol



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

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