Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the value of one cell in a worksheet

Status
Not open for further replies.

asmith555

Programmer
Oct 7, 2002
97
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top