1. Jaafar Tribak

    Listening to the UserForm_Activate event using WithEvents in a Class Module.

    Hi, Say for example, you have a couple of modeless userforms on display and you want to run some small macro each time you activate each userform. The obvious answer is simply placing the small macro (or a call to it) in each of the UserForm_Activate event handlers. But what If you wanted to...
  2. Jaafar Tribak

    Safe MouseWheel Event Hook (Addin)

    Hi dear forum, In the past few months, I have posted various codes which show how to run code upon wheelmouse-scrolling. Basically, intercepting the mouse scroll event relies on four known techniques : Subclassing, Installing a windows Mouse Hook, using the SetWinEventHook API or using the...
  3. bobsan42

    WithEvents Form AccessObject ... conundrum

    Hello all. My goal at the moment is: To open Form1 as background, make it translucent, then use the openArgs to pass a name to open Form2 on top of it. When Form2 is closed Form1 to close automatically. I achieved it easily with DoCmd.OpenForm but then I have to set WindowMode:=acDialog, which...
  4. A

    Change Event for Multiple Check Boxes

    I have 25 text boxes named in the following manner on a UserForm Name: id_[X]_box 1<= x <= 25 I am trying to write a program which can register a change event for all 25 boxes and populate the corresponding [DESCRIPTION] Labels. Naming scheme for Description Labels Name: desc_[X]_label 1 <= X...
  5. ClimoC

    Single Class and EventHandler for multiple Control types in Userform?

    Howdy gang Trying to do a shortcut - Userform is having dynamic number of items created at runtime for the user to interact with. I've done this successfully with Checkboxes, and that's all fine - but I was as I'm adding a lot of textboxes and comboboxes, and they all need an event fired on...
  6. T

    WithEvents for a Shape

    I am trying to find an event for a shape but this does not work: Public WithEvents ShapesEvent As Shapes because VBA doesn't recognise Shapes. What should I declare it as? Thanks
  7. L

    Help with Outlook VBA

    I know this is not directly Excel related, but I don't know if MR OUTLOOK exists, and the issue is related to trying to open a worksheet as a result of a certain email being delivered. I previously had code in ThisOutlookSession that would mark deleted items read when they were added to the...
  8. 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...
  9. V

    Using group email as default sender address for Reply , Forward and New Email

    I have a problem with my macro for outlook. I've created VBA as below to change default sender email address in Reply , Forward and New Email. I want to use group email as default sender address for all outgoing email. But it can work fine only for New Email. It does not work in Reply and...
  10. Jaafar Tribak

    Prevent renaming worksheets without locking the workbook structure

    Hi, I have seen this question asked before and the usual workaround is to restore the worksheet name after the sheet has been renamed.. This is often done in the Worksheet Selection Change or deactivate events as follows : Private Sub worksheet_SelectionChange(ByVal Target As Excel.Range)...
  11. P

    Convert VB code to VBA

    Morning folks (At least it is where I am). Hoping for some guidance please. Not sure if this is the best idea or even possible, but here goes. Sorry if its a ramble and a long post, but there's information here that is beyond my meager experience and skills, but may well be perfectly clear and...
  12. Jaafar Tribak

    Nifty Class for Trapping Mouse Clicks on Cells

    Hi all, There are times when excel users need to detect when a cell is being mouse-clicked ... The worksheet Selection_Change event is often used for this purpose but it has two main problems : A- it doesn't differenciate between keyboard and mouse selections B- It doesn't work if the same cell...
  13. C

    What Triggers a Class Module to be Read?

    I've been coding in Excel VBA for a while, but am fairly new to using Class Modules. One of the classes I have created depends on another user-defined class that is defined in an add-in that only a few employees at my firm have. My issue is that whenever someone who doesn't have this add-in...
  14. Jaafar Tribak

    Sinking events of a remote workbook

    Hi all, I am not experienced with network programming so I am asking here if the following prank would work (this is just an illustrative example) Ok- Let's say a remote workbook (located in a network shared Drive/Folder) is currently opened by some user on the network and I wanted to play a...
  15. R

    VBA Collection Items Get Overwritten

    I am attempting to add form controls dynamically to a blank form, and build a collection of those controls so I can write my own events. I'm having limited success. The controls are successfully adding to the form, appear to be adding to the collection, but my click() event only works for the...
  16. Jaafar Tribak

    Challenging problem - Generic CommandButton Click Event w/o a seperate Class module !!

    Greetings all. Let me see if I can explain this clearly. Suppose I have a UserForm with 10 CommandButtons. Each CommandButton has the same code inside its _Click event handler. Now, because the Click event code for each CommandButton are the same ,we can, as you know, use a small Class...

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