How to code it in macro?

E

Eric

Does anyone have any suggestions on how to code it in macro?
If cell A1 = B1 under ABC sheet on DEF.xls file, then process following
code, then nothing.
Does anyone have any suggestions on how to code and retrieve value from this
specific cells?
Thanks in advance for any suggestions
Eric
 
J

joel

Set Databk = workbooks.open(filename:="c:\temp\DEF.xls")
Set Datasht = Databk.sheets("ABC")

with Datasht
if .Range("A1") = .Range("B1") then
'add your code here
end if

end With

Databk.close savechanges:=false
 
E

Eric

Will it be possible to retrieve the value without opening the worksheet?
Thank you very much for any suggestions
Eric
 
J

joel

there are only two way s of getting data out of a workbook withou
opening the workbook.

1) Add a formula to a worksheet. You can do this with a macro.
2) Red/Write data to the workbook like a database using the AD
method. This uses the Access Database library functions. Thi
technicaly doesn't open the file but make a connection to the file. Yo
can have multiple people working on the same workbook simulataneously.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top