class module

  1. R

    Simple Class module example required

    Help Can anyone provoide me with a very simple Class module example that captures for example peoples first names in column "A", Surnames in column "B" and loops through that column and adds them to a collection. I think if i had a bog standard example i might actually get it! Then I can build...
  2. SharmaAntriksh

    Excel Class Modules

    I have tried to create class module that accepts range i want to know if there is a way to expand this and create custom properties for that range object? Code in the Class Module "cRange": Option Explicit Private pRange As Range Public Property Set MyRange(r As Range) Set pRange = r...
  3. Tim_Excel_

    Workbook_SheetChange event loses reference to Workbook

    Hi forum, I have a Workbook_SheetChange event for another workbook (other than the workbook that holds the code). At the end of a lengthy Sub, I call for the Sub that defines the Workbook's name that the event needs to work for: Sub step1() '''''code'''' NameGrabber.DefineWorkbookName End...
  4. S

    Object Variable Not Set - Class Module inside Class Module

    I'm trying to assign a Class Module known as Port to part of another Class Module , here's the code so far: The port class module is as follows Private pName As String ' Properties Public Property Let Name(Value As String) pName = Value End Property Public Property Get Name() As String...
  5. M

    VBA- adding custom properties to Label controls

    Hi, I need to assing some properties to my labels which are generated on runtime (on a Class Module). I am using their TAG and Controltiptext properties, I need some more proterties to set and control these labels during the runtime. I am not sure If i should use some property procedures. If...
  6. M

    Access a Friend function in a Class module from a standard Moldule

    Hello. I´m trying to make my procedure faster, which starts with reading a few MB txt file line by line and by checking for the presence of a string in each line. For testing I downloaded this code, which is ought to make the InStr search much faster...
  7. F

    Class module for checkboxes

    I have a class module set to encompass ALL checkboxes on sheet, so that when any of them are clicked, a sub will run to populate some cells. It works great, but I'm having some trouble because I still want to group some of the cells together to create a user form. I'll have tons of checkboxes...
  8. N

    How to use Class Module for looping

    Hello MrExcel, Some website mentioned that using "Class Module" can make our code more clean. I also want to try it that way. I have create a class named "Car" which contain 3 main properties. Price+Color+Size. In another worksheet, i have table for each car which each of them contain...
  9. N

    Multi userform validate for textbox,Checkbox,optionbutton is not empty using class module codes

    Hi All, I have design & build 9 to 10 userforms. I need to validate each user-form's Textbox and optionbutton,Checkbox are selected or not if its not selected then code should be stop. To every userform i have put below code to validate Textbox optionbutton,Checkbox are selected Private Sub...
  10. T

    Want Know class module some asks...

    Hi guys I want some issue I make a class module with excel application I want module1= dim class as class module class module= 1) when cell duoubleclick 2) userform.show 3) before form close input a value to cell 4) form close next time 1-2-3-4... but... 1) when cell duoubleclick 2)...
  11. M

    Excel Class Module Implementation (Basic Level)

    Hello good people, I had a problem that I found the answer for, but it says "This code needs to be posted in a class module and an instance of the class needs to be created before it will work". I am very familiar with "Modules" but never used Class Modules before, and can't seem to be able to...
  12. M

    Class Module for ComboBoxes AND OptionButtons. Seeking advice: How to include both?

    Hello all, I come as a novice seeking advice from the amazing minds I see here! Guided by this code: ' Class module named TBClass Public WithEvents TBGroup As MSForms.TextBox Private Sub TBGroup_Change() MsgBox TBGroup.Name & " changed" End Sub ' UserForm module Dim TBs() As New...
  13. X

    Optional Arguments in Properties of a Class

    I have a class for a cylinder and i want the user to have the option not only to read the volume of the cylinder but to write the volume and preserve the height, radius or proportion by user's choice. I'm with this code for that condition: Public Enum PreserveRelationType PreserveRadius = 0...
  14. F

    Form events using set property

    Hi! I'm trying to assign events to the text- and comboboxes in a userform. It works fine as long as I just add one of the control types (TextBox or ComboBox), or assign each control to a different property name.The problem occurs when I'm assigning both Textbox and ComboBox to the same in...
  15. D

    VBA Creating a Collection in a Class Module

    Hi this is my first time posting on this forum so I hope I am putting this in the right place. I am currently reading MrExcel's "VBA and Macros: Microsoft Excel 2013" and I am having trouble understanding a section in chapter 9 called "Creating a Collection in a Class Module". Earlier in the...
  16. D

    VBA and Macros 2013 - Creating a Collection in a Class Module

    Hi this is my first time posting on this forum so I hope I am putting this in the right place. I am currently reading MrExcel's "VBA and Macros: Microsoft Excel 2013" and I am having trouble understanding a section in chapter 9 entitled "Creating a Collection in a Class Module". Earlier in the...
  17. S

    Listview add at run time with class module for event handling

    I'm having problems deploying a vba project on PCs throughout my organisation due to differences in windows configurations (I think). I have checked that MSCOMCTL.ocx is available on each PC and the listview control is available in the form controls menu (tools). As a side note, when I tried...
  18. J

    Get variable value in userform from Class module

    I want to monitor when a value changes of several combo buttons on a user form. I have set this up using a class module to capture all the comboboxes on the userform. I have the following code in a class module called “ModComboClass”: Public WithEvents ComboGroup As MSForms.ComboBox Public Sub...
  19. D

    VBA - On_click event with userform checkoxes

    Hi, I'm having some difficulties with some code that I cant quite piece together. I have a Userform which allows a user select a desired parameter from a listbox. Depending on the user's selection a set of checkboxes are created in a neighbouring frame. The checkboxes are iterated and produced...
  20. J

    class module for multiple commandbutton click event

    I have a user form with 50 rows each containing the controls in order as: Togglebutton101, Togglebutton1, Textbox301, Checkbox1, Textbox1, Combobox1, Combobox101, Checkbox101 and a Commandbutton1. What I want to do is when I click the commandbutton1 then its preceding controls in its row...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top