Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman
Thanks for your help, problem solved. "Norman Jones" wrote: Hi Sommer, To add, It appears the code only considers the first part of the named range and not the entire string. See 'Areas Collection Object' in VBA help. See particularly the comments immediately preceding the help example. --- Regards, Norman "Norman Jones" wrote in message ... Hi Sommer, Based on a suugestion by Dana DeLouis, try: Sub Tester03() Dim i As Long i = Intersect(Range("Data").EntireRow, _ Columns(1)).Cells.Count MsgBox i End Sub --- Regards, Norman "sommer" wrote in message ... I would like to count the number of rows in a named range that contains multiple areas on the same worksheet. To setup the range, I held the Control key down while selecting the three different areas and then selected InsertNameDefine to establish the "data" range. The following code yields 10 rows and not the expected 21. It appears the code only considers the first part of the named range and not the entire string. Any help would be appreciated. Thanks Sommer Names in workbook: data Refers to: =Sheet1!$A$3:$M$12,Sheet1!$A$25:$M$30,Sheet1!$A$40 :$M$44 Macro code: Set CheckArea = Range("data") NumberOfRows = CheckArea.Rows.Count |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
pivot table - Can I pre-define rows and columns? | Excel Discussion (Misc queries) | |||
problem with Rows.Count and comparing cells | Excel Programming | |||
Problem with UsedRange.Rows.Count | Excel Programming | |||
problem using Set statement to define range object | Excel Programming | |||
Define Range in Deleting Empty Rows | Excel Programming |