Help Plss

V

vmadan16

Helo All,

I have 6 workbooks and out of that one is a admin workbook where the
calculations are done. In that admin workbook I should get the last modified
date of the all other 5 workbooks.

I have a Commandbutton (Caption : Reset) in the admin Work if I click that
then in all other 5 workbooks range of B6:B14 in all the 5 workbooks should
reset to 0.

Plesase help me out with this.
It will be really help full for me.

Thanx in Advance.
Madhan
 
B

Bob Phillips

With Workbooks("Admin").Worksheets("Sheet1")

Workbooks.Open(Filename:="C:\MyFiles\Workbook1.xls")
Activeworkbook.Worksheets("Sheet1").Range("B6:B14").ClearContents
.Range("A1").Value = DocProps("last save time")
Activeworkbvook.Close SaveChanges:=False

Workbooks.Open(Filename:="C:\MyFiles\Workbook2.xls")
Activeworkbook.Worksheets("Sheet1").Range("B6:B14").ClearContents
.Range("A2").Value = DocProps("last save time")
Activeworkbvook.Close SaveChanges:=False

Workbooks.Open(Filename:="C:\MyFiles\Workbook3.xls")
Activeworkbook.Worksheets("Sheet1").Range("B6:B14").ClearContents
.Range("A3").Value = DocProps("last save time")
Activeworkbvook.Close SaveChanges:=False

Workbooks.Open(Filename:="C:\MyFiles\Workbook4.xls")
Activeworkbook.Worksheets("Sheet1").Range("B6:B14").ClearContents
.Range("A4").Value = DocProps("last save time")
Activeworkbvook.Close SaveChanges:=False

Workbooks.Open(Filename:="C:\MyFiles\Workbook5.xls")
Activeworkbook.Worksheets("Sheet1").Range("B6:B14").ClearContents
.Range("A5").Value = DocProps("last save time")
Activeworkbvook.Close SaveChanges:=False

End With


'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function



change the folder and workbooks to suit

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
V

vmadan16

Hi bob,

Thanx.

THe code which you have given the first line of each para for example below
line
Workbooks.Open(Filename:="C:\MyFiles\Workbook1.xls")
Workbooks.Open(Filename:="C:\MyFiles\Workbook2.xls")

shows error. syntax error.
pls help

Thanx in Advance
Madhan
 
B

Bob Phillips

Sorry my mistake, the brackets are not needed

Workbooks.Open Filename:="C:\MyFiles\Workbook1.xls"

Workbooks.Open Filename:="C:\MyFiles\Workbook2.xls"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
V

vmadan16

Thanx Bob,

Thanx a lot.



Bob Phillips said:
Sorry my mistake, the brackets are not needed

Workbooks.Open Filename:="C:\MyFiles\Workbook1.xls"

Workbooks.Open Filename:="C:\MyFiles\Workbook2.xls"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
V

vmadan16

Hi Bob,

I have another doubt in Access. Can you help in that also. I have explained
it below.

There are 3 tables
1. Account - (Fields - Account name, Accountid, Address, etc)
2. Account Misc - (Fields - Accountid, cpnum, Cluster, etc..)
3. CC - (contains only Account name field)

Both the tables have one same field Accountid. Joined 2 tables usig that
Accountid field. to retrive the Cpnum and cluster from Account Misc through
Account name field in Account table.

I want the cpnum and cluster field alone to be filled in the CC table.
The CC table does not have the exact match of the Account table for example
CC table have Microsoft corporation but in the account table only Microsoft
will be there. another example ASAP S.A Ltd in CC table it will be ASAP in
Account table.
One more thing the CC table may have data which the Account table does not
have so in that cases there should be a blank space in the CC table to
respective areas.

Pls help me out with this macro.
 

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