I am new with excel vba. I am trying to get the value of a single cell in a specific worksheet. Also I am trying to dynamically open another workbook. Get a value from a single cell and close the workbook. Can anyone give me a heads up on how to do this.
Something like this ?
Dim WB As Workbook
Set WB = Workbooks.Open("\path\to\file.xls")
MsgBox "Cell value = " & WB.Sheets("sheet's name").Range("A1").Value
WB.Close False
Set WB = Nothing
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.