U
UIBC
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.
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.