I get a 'Run-time error 13' message with the code below on the line:
stockdataLengtha = UBound(stockdataa, 0)
What is wrong and how can i rectify this????
Thank you in advance.
Option Explicit
Sub lenght()
Dim stockdataa As Variant
Dim stockdataLengtha As Integer
Sheets("Prob1").Select
stockdataa = Range("A1:A20").Select
stockdataLengtha = UBound(stockdataa, 0)
MsgBox "Length is is " & stockdataLengtha
End Sub
stockdataLengtha = UBound(stockdataa, 0)
What is wrong and how can i rectify this????
Thank you in advance.
Option Explicit
Sub lenght()
Dim stockdataa As Variant
Dim stockdataLengtha As Integer
Sheets("Prob1").Select
stockdataa = Range("A1:A20").Select
stockdataLengtha = UBound(stockdataa, 0)
MsgBox "Length is is " & stockdataLengtha
End Sub