C
cparsons
I have the following code in my macro to help me count the rows in m
spreadsheet. The problem I am having is the cell it is looking at i
empty but has a formula in it. It appears that it is counting th
formulas too. How can I only count the cells that have data in them?
Code
-------------------
With Worksheets(Cur_Month).Range("EMP_HR_ID")
If .Offset(0, 0) = "" Or Null Then
MsgBox ("There were no HRIDs to process. Please Update the Information and Rerun the Application.")
HRID_cnt = 0
ElseIf .Offset(1, 0) = "" Or Null Then
HRID_cnt = 1
Else
HRID_cnt = Range(.Offset(0, 0), .End(xlDown)).Rows.Count
End If
End Wit
spreadsheet. The problem I am having is the cell it is looking at i
empty but has a formula in it. It appears that it is counting th
formulas too. How can I only count the cells that have data in them?
Code
-------------------
With Worksheets(Cur_Month).Range("EMP_HR_ID")
If .Offset(0, 0) = "" Or Null Then
MsgBox ("There were no HRIDs to process. Please Update the Information and Rerun the Application.")
HRID_cnt = 0
ElseIf .Offset(1, 0) = "" Or Null Then
HRID_cnt = 1
Else
HRID_cnt = Range(.Offset(0, 0), .End(xlDown)).Rows.Count
End If
End Wit