LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Range error - How does this work and what am I doing wrong?

I am stuck. I have a spreadsheet that I want to be able to select certain
stocks in col A and have the charts in col b loop through. An example of my
sheet is:
COL A COL B
BBBY http://finance.yahoo.com/q?s=BBBY
BGP http://finance.yahoo.com/q?s=BGP
BKS http://finance.yahoo.com/q?s=BKS

My code follows:Sub Count_Selection()
Dim cell As Object
Dim chart As String
Dim count As Integer

count = 0
For Each cell In Selection
If cell = " " Then End

chart = ActiveCell.Offset(0, 1)

Range("chart").Select

count = count + 1

Next cell

MsgBox count & " item(s) selected"
End Sub
I get a "Methond Range of Worksheet failed" error, but I don't understand if
I should define col B as a range, and if so how to do that.

Any help you can lend someone trying to learn VBA would be greatly
appreciated.



 
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
FIND method doesn't work in UDF. What's wrong with this code? [email protected] Excel Programming 10 July 9th 05 05:32 PM
help NEEDED URGENTLY (I HAVE TRIED SOME SUGGESTIONS BUT THEY DONT WORK UNLESS I AM DOING THEM WRONG gordo Excel Worksheet Functions 8 June 26th 05 07:40 PM
VBA: For Each.... wont work correctly / is placement wrong? Mcasteel[_35_] Excel Programming 0 November 10th 04 02:42 AM
Excel Macro Problem, Add-in need to work in every workbook & Error:9 Subscript out of range Burak[_2_] Excel Programming 1 October 31st 03 08:09 PM


All times are GMT +1. The time now is 02:02 PM.

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"