oakwood_001
Board Regular
- Joined
- Apr 4, 2008
- Messages
- 108
Hi All,
I'm trying to assign the number of cells (blank or non blank) in a given range to a variable but everytime I try, I get a runtime 1004 error.
Can you help?
Dim strStartingConCell As String
Dim strStartingUniqueCell As String
Dim x As Integer
Dim y As Integer
strStartingConCell = InputBox("Starting Concatenated Cell")
strStartingUniqueCell = InputBox("Starting Unique Cell")
y = WorksheetFunction.Count(Range(strStartingConCell, Selection.End(xlDown))
x = WorksheetFunction.Count(Range(strStartingUniqueCell, Selection.End(xlDown))
I think you get what I'm trying to do from this (I hope).
I also tried selecting each cell first. Then tried selecting the range first but it didn't like Count(Range(Selection))
Any help is very much appreciated.
Thanks.
I'm trying to assign the number of cells (blank or non blank) in a given range to a variable but everytime I try, I get a runtime 1004 error.
Can you help?
Code:
Dim strStartingUniqueCell As String
Dim x As Integer
Dim y As Integer
strStartingConCell = InputBox("Starting Concatenated Cell")
strStartingUniqueCell = InputBox("Starting Unique Cell")
y = WorksheetFunction.Count(Range(strStartingConCell, Selection.End(xlDown))
x = WorksheetFunction.Count(Range(strStartingUniqueCell, Selection.End(xlDown))
Code:
I think you get what I'm trying to do from this (I hope).
I also tried selecting each cell first. Then tried selecting the range first but it didn't like Count(Range(Selection))
Any help is very much appreciated.
Thanks.