LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Selection.count isnt working

I am testing a macro and I cant figure out what I'm doing wrong. I have
named a range, dvec, that contains contiguous data. I want to pass the
number of data points, n, to the array cvec(n). To test this I inserted the
MsgBox line. When I run this macro, I get the number of rows in the range
dvec rather than the count of data points. What am I doing wrong? I have
made sure all blank cells in the range are clear.

Option Base 1
Sub SelectCount()
'Re-Dim data array cvec
Dim n, cvec
Sheets("Sheet2").Range("dvec").Select
n = Selection.Count
ReDim cvec(n)
MsgBox "The size of vector cvec is " & n
End Sub

TIA

Steve H


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested IF isnt working right..Why? Curtis Excel Worksheet Functions 1 October 30th 09 10:08 PM
Conditional Formatting isnt working right changetires Excel Discussion (Misc queries) 6 June 28th 06 08:47 PM
autofilter isnt working john mcmichael Excel Discussion (Misc queries) 2 October 19th 05 07:53 PM
Function isnt working, just displays the formula in cell?eg A2+B2 ru Excel Discussion (Misc queries) 1 September 30th 05 01:35 PM
AutoFill isnt working? M.L Excel Discussion (Misc queries) 7 June 16th 05 08:58 PM


All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"