Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUp when Macro Opens WorkBooks
Sub Quote()
Dim mybook As Workbook Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = "C:\Documents and Settings\Javier\My Documents\Test\" ChDrive MyPath ChDir MyPath FNames = Dir("*.xls") If Len(FNames) = 0 Then MsgBox "No files in the Directory" ChDrive SaveDriveDir ChDir SaveDriveDir Exit Sub End If Application.ScreenUpdating = False Do While FNames < "" Set mybook = Workbooks.Open(Filename:=FNames, _ UpdateLinks:=0) mybook.Worksheets(1).Range("D17").Formula = _ "= C17*1.3352" mybook.Worksheets(1).Range("C25").Formula = _ "=(SUM(B25*F20)/F19)/1.3352" mybook.Close True FNames = Dir() Loop ChDrive SaveDriveDir ChDir SaveDriveDir Application.ScreenUpdating = True End Sub -- Regards, Tom Ogilvy "JavyD" wrote in message ... It's the popup message box that says this work book contains automatic links to information in another work book. Do you want to update this work book, bla bla bla, yes or no. That's the message that I have to click no on 400 times. "sebastienm" wrote: Hi JavyD, what VLook Up message ? is it a message displayed by your macro. I can't think of any vlook message from excel itself. Regadrs, Sébastien "JavyD" wrote: Hello guys, I have a macro at the moment, thanks to the help of Tom and Ron. What it does it opens up over 400 work books, changes a few cells, then saves them and closes them. Now each of these 400 work books, has hundreds of VLook Ups. How can I add to this macro more code that when the macro opens the report, that the VLook Up message doesnt pop up, and I have to sit there for an hour clicking no no no no, dont update? Regards, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUp when Macro Opens WorkBooks
Amazing Tom, lets see if it works when I get in the office tomorrow.
"Tom Ogilvy" wrote: Sub Quote() Dim mybook As Workbook Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = "C:\Documents and Settings\Javier\My Documents\Test\" ChDrive MyPath ChDir MyPath FNames = Dir("*.xls") If Len(FNames) = 0 Then MsgBox "No files in the Directory" ChDrive SaveDriveDir ChDir SaveDriveDir Exit Sub End If Application.ScreenUpdating = False Do While FNames < "" Set mybook = Workbooks.Open(Filename:=FNames, _ UpdateLinks:=0) mybook.Worksheets(1).Range("D17").Formula = _ "= C17*1.3352" mybook.Worksheets(1).Range("C25").Formula = _ "=(SUM(B25*F20)/F19)/1.3352" mybook.Close True FNames = Dir() Loop ChDrive SaveDriveDir ChDir SaveDriveDir Application.ScreenUpdating = True End Sub -- Regards, Tom Ogilvy "JavyD" wrote in message ... It's the popup message box that says this work book contains automatic links to information in another work book. Do you want to update this work book, bla bla bla, yes or no. That's the message that I have to click no on 400 times. "sebastienm" wrote: Hi JavyD, what VLook Up message ? is it a message displayed by your macro. I can't think of any vlook message from excel itself. Regadrs, SĂ©bastien "JavyD" wrote: Hello guys, I have a macro at the moment, thanks to the help of Tom and Ron. What it does it opens up over 400 work books, changes a few cells, then saves them and closes them. Now each of these 400 work books, has hundreds of VLook Ups. How can I add to this macro more code that when the macro opens the report, that the VLook Up message doesnt pop up, and I have to sit there for an hour clicking no no no no, dont update? Regards, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel opens two workbooks | Excel Discussion (Misc queries) | |||
Excel workbooks opens in Outlook. Why? | Excel Discussion (Misc queries) | |||
Excel opens all workbooks within the same app window. | Excel Discussion (Misc queries) | |||
VLookUp when Macro Opens WorkBooks | Excel Programming | |||
VLookUp when Macro Opens WorkBooks | Excel Programming |