I have some VBA in an Excel 2010 document which returns "nothing" when I try to assign a range from a different worksheet. I can reference the value of a cell within the range with no problems.
Why does the code below leave the rng variable set to Nothing, when the value of s3 correctly contains the value of the first cell in that range??
Dim s3 As String
Dim rng As Range
Set SourceFile = Application.Workbooks.Open("c:\finance\inv.xls")
Set SourceSheet = SourceFile.Worksheets(Source)
s3 = SourceSheet.Range("A3").Value
rng = SourceSheet.Range("A3:A30")
No comments:
Post a Comment