Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel opens two workbooks ChristyL Excel Discussion (Misc queries) 3 September 25th 08 04:25 PM
Excel workbooks opens in Outlook. Why? rozcats Excel Discussion (Misc queries) 1 April 9th 07 10:42 PM
Excel opens all workbooks within the same app window. rana Excel Discussion (Misc queries) 2 January 27th 06 09:20 AM
VLookUp when Macro Opens WorkBooks Jim Thomlinson[_3_] Excel Programming 2 August 26th 04 05:21 AM
VLookUp when Macro Opens WorkBooks David Adamson[_4_] Excel Programming 0 August 26th 04 12:15 AM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"