Hello Everybody,
I need help where I used the code [to count the number of samples within a unknown range] and it worked:
Const COL_RESULTS = 2 ' all results in this column
Const ROW_RESULTS = 13 ' reference row
Const ROW_SAMPLES = ROW_RESULTS + 1 ' how many wind samples found
Sub Count_Selection()
Dim cell As Variant
Dim count As Integer
For Each cell In Selection
If cell > 0 Then
count = ROW_SAMPLES
End If
End Sub
However the Selection Part has to be an unknown range, inwhich when I use this code whichever workbook I use it can be implemented. I don't know how to add this unknown range into this code.
Also the count = ROW_SAMPLES is a function where i go onto excel and type:
= count(range)
it gives me the answer
But I'm not allowed to do that I have to let it run normally and let the answer end up in cell "I17"
Any Help will be appreciated :] thankyou!
I need help where I used the code [to count the number of samples within a unknown range] and it worked:
Const COL_RESULTS = 2 ' all results in this column
Const ROW_RESULTS = 13 ' reference row
Const ROW_SAMPLES = ROW_RESULTS + 1 ' how many wind samples found
Sub Count_Selection()
Dim cell As Variant
Dim count As Integer
For Each cell In Selection
If cell > 0 Then
count = ROW_SAMPLES
End If
End Sub
However the Selection Part has to be an unknown range, inwhich when I use this code whichever workbook I use it can be implemented. I don't know how to add this unknown range into this code.
Also the count = ROW_SAMPLES is a function where i go onto excel and type:
= count(range)
it gives me the answer
But I'm not allowed to do that I have to let it run normally and let the answer end up in cell "I17"
Any Help will be appreciated :] thankyou!