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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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

Forum statistics

Threads
1,224,749
Messages
6,180,727
Members
452,995
Latest member
isldboy

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