![]() |
Help Plss
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 |
Help Plss
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) "vmadan16" wrote in message ... 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 |
Help Plss
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 "Bob Phillips" wrote: 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) "vmadan16" wrote in message ... 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 |
Help Plss
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) "vmadan16" wrote in message ... 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 "Bob Phillips" wrote: 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) "vmadan16" wrote in message ... 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 |
Help Plss
Thanx Bob,
Thanx a lot. "Bob Phillips" wrote: 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) "vmadan16" wrote in message ... 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 "Bob Phillips" wrote: 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) "vmadan16" wrote in message ... 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 |
Help Plss
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. |
All times are GMT +1. The time now is 02:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com