ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do i execute a VBA function by clicking on an excel cell? (https://www.excelbanter.com/excel-discussion-misc-queries/59051-how-do-i-execute-vba-function-clicking-excel-cell.html)

Matthew

How do i execute a VBA function by clicking on an excel cell?
 
I am trying to open a file in a program (Microsoft) by clicking on an excel
file.

Initially I tried a regular hyperlink, but excel seems to ignore the
[filename] part of: c:\directory\ustation.exe [filename] where
[filename] is the actual name of the file. Excel only opens the program, not
the file as well. Where as this DOES work as a command prompt from a command
window.

So I have written a function in VBA which does work. But I can't get excel
to execute the function when I click on the cell, like a hyperlink.

Dave Peterson

How do i execute a VBA function by clicking on an excel cell?
 
How about just putting a little button from the Forms toolbar next to that cell.

Then assign your macro to that little button.

Matthew wrote:

I am trying to open a file in a program (Microsoft) by clicking on an excel
file.

Initially I tried a regular hyperlink, but excel seems to ignore the
[filename] part of: c:\directory\ustation.exe [filename] where
[filename] is the actual name of the file. Excel only opens the program, not
the file as well. Where as this DOES work as a command prompt from a command
window.

So I have written a function in VBA which does work. But I can't get excel
to execute the function when I click on the cell, like a hyperlink.


--

Dave Peterson


All times are GMT +1. The time now is 08:39 PM.

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