Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CountA formula

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
I want to set up an array but as a precursor to setting the bounds of the array I want to count the amount of variables in the H column.

This is what I have so far.

Code:
Sub DefineArray()
Dim LR As Long
Dim LowValue As Double

 LR = ActiveSheet.UsedRange.Rows.Count

 LowValue = Application.WorksheetFunction.CountA(Range("H2:H & LR"))

End Sub
 

Hi,

The count of VALUES in column H...
Code:
Sub DefineArray()
Dim LR As Long
Dim LowValue As [b]Long[/b]

 LR = ActiveSheet.UsedRange.Rows.Count

 LowValue = Application.WorksheetFunction.CountA(Range("H:H"))

End Sub
or
Code:
Sub DefineArray()
Dim First As Long
Dim Last As Long

 With ActiveSheet.UsedRange.Rows
    first = .row
    last = first + .rows.count - 1
 End with
End Sub


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top