Standard module, UserForm Module or Class Module? ??

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
There are some of the Subs that when I call them from the standard module with my userform, I get errors so I have to place them in the userform module. I have not used the class module before.

Can someone point out to me whether I am doing the right thing or not?

Regards
Kelly
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,
you can call a procedure in standard module from your userform & work with the forms objects within that code.

- To understand what your issue is, it would be helpful if you post the codes you are having problems with & someone here should be able to offer guidance to resolved.

Dave
 
Last edited:
Upvote 0
This is the code. I have to call it from the userform module before it works error-free

Sub Test()
Dim Addr As String
Addr = Range("D7:N" & Cells(Rows.Count, "A").End(xlUp).Row).Address
Range(Addr) = Evaluate("IF(" & Addr & "<1,""""," & Addr & ")")
End Sub
 
Upvote 0
Apart from ranges are not qualified - I just created a UserForm & called your code in a standard module & it reported no error.

What error(s) are you getting?

Dave
 
Last edited:
Upvote 0
Compile error

Expected variable or procedure, not a module
 
Upvote 0
Compile error

Expected variable or procedure, not a module

Have you named the module the same as the Procedure? If so, Name your module something like this Test_Code


Dave
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top