Update Button

  • Thread starter Thread starter samplesmatt
  • Start date Start date
S

samplesmatt

The goal is to have an ultra simplified system for updating a
spreadsheet’s status (i.e. a button that says "update dates"). The
update will come from a dbase or lotus 1-2-3 (the only two export
options) output from project management software and saved periodically
at "c:\MPIC.dbf". Upon clicking the "update dates button” in the
worksheet the new dates will be retrieved from the (unopened) .dbf
using a vlookup type function (lookup the activity and return me the
two dates). I have tried just a simple vlookup function, but excel
will not stayed linked with a .dbf, so as soon as it is closed it
cannot find the file. Plus vlookup maintains a constant link, which
does not allow for a user to update as they wish. Anyone have any
suggestions? Thanks.
 
This code will open and close your file, when the lookup should update :-
'----------------------------------------------
Sub UPDATE()
Dim MyPath As String
Dim MyBookName As String
'---------------------------------
Application.ScreenUpdating = False
MyPath = "C:\temp\"
MyBookName = "MPIC.dbf"
Workbooks.Open MyPath & MyBookName
Workbooks(MyBookName).Close savechanges:=False
Application.ScreenUpdating = True
End Sub
'---------------------------------------------

Regards
BrianB
============================================
 

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

Back
Top