ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling a function in a worksheet from a user form (https://www.excelbanter.com/excel-programming/350947-calling-function-worksheet-user-form.html)

Steve

calling a function in a worksheet from a user form
 
How can I call a function in the code from a worksheet while in the code for
a form? For example, I have a function called GetData1 in a worksheet
"Part#". I want to call this functio from the VB code in a form "Status", but
'Call GetData1' doesn't work. Neither does 'Call Part#.GetData1'. Any ideas?

Bob Phillips[_6_]

calling a function in a worksheet from a user form
 
If the function is Public, you could call it by the sheet's codename

Sheet1.GetData1

but why not just move the function to a standard code module.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"steve" wrote in message
...
How can I call a function in the code from a worksheet while in the code

for
a form? For example, I have a function called GetData1 in a worksheet
"Part#". I want to call this functio from the VB code in a form "Status",

but
'Call GetData1' doesn't work. Neither does 'Call Part#.GetData1'. Any

ideas?




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

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