run app on database "refresh"

M

MikeF

Re an Access database query on an Excel sheet ...

This database contains a hyperlink field to individual websites.
For unknown reasons, with some sites, it returns their addresses with a "#"
on each end, making the hyperlinks invalid.
Have created a small sub-routine that runs manually, off a button, which
removes those characters, thereby enabling the website.

But ... it has to be run manually, each time the "refresh" command is run.
The sub's name is Sub FixHyperlinks().

Can anyone please suggest a way to have this run automatically in Excel each
time the database query is refreshed?

Thanx.
- Mike
 
K

Kenneth Hobson

Right click the sheet's tab, View Code, and paste:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
FixHyperlinks
applicaiton.EnableEvents = True
End Sub
 

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