ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run app on database "refresh" (https://www.excelbanter.com/excel-programming/424145-run-app-database-refresh.html)

MikeF[_2_]

run app on database "refresh"
 
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

Kenneth Hobson[_4_]

run app on database "refresh"
 
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


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com