Prev: Sort a Column
Next: Manipulating Table data
From: Eric on 20 Mar 2010 20:11 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
From: joel on 21 Mar 2010 00:03 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 -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=189250 http://www.thecodecage.com/forumz/chat.php
From: Eric on 21 Mar 2010 00:44 Will it be possible to retrieve the value without opening the worksheet? Thank you very much for any suggestions Eric "joel" wrote: > > 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 > > > -- > joel > ------------------------------------------------------------------------ > joel's Profile: 229 > View this thread: http://www.thecodecage.com/forumz/showthread.php?t=189250 > > http://www.thecodecage.com/forumz/chat.php > > . >
From: joel on 21 Mar 2010 01:31 there are only two way s of getting data out of a workbook without 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 ADO method. This uses the Access Database library functions. This technicaly doesn't open the file but make a connection to the file. You can have multiple people working on the same workbook simulataneously. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=189250 http://www.thecodecage.com/forumz/chat.php
|
Pages: 1 Prev: Sort a Column Next: Manipulating Table data |