1. M

    Run macro on event

    Hi guys, I have the working code below, however when I try to added to run in a change event the Range with lastrow stops working, wondering if any of you can advice on what can I do? Sub field_change() Dim LastRow As Integer With ActiveSheet LastRow =...
  2. A

    Use Before Save Event to Prevent Saving If No Checkboxes Are Selected

    Hello! I am attempting to use the BeforeSave event to check whether any of the checkboxes are selected before allowing the user to save the workbook. Please see my code below. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Entered Sub...
  3. K

    Worksheet_BeforeRightClick - run macro automatically when right click on cell and select "New Note"

    Dear Guys, I have an older macro which ran well in earlier versions: when I right clicked on a cell and selected "Insert Comment": a macro ran automatically: of course I added following code to the appropriate sheet Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As...
  4. R

    Event codes with two conditions

    Hi, Can you please help me get an event code with two conditions to generate a message for two scenarios as follows? 1) I am trying to translate this formula into VBA: IF(AND($A1="Home",$B1="School"),"Invalid Combination","") I want the event code to check these conditions for rows 1 to 20. I...
  5. L

    conditional formatting

    Hi I have the table below. I want to use conditional formatting or any other way to highlight the event based on condition like the following: If the event takes less than 14 days, then I highlight "Current" in the 3rd column. but not to highlight the "xmas" or any other events which have...
  6. L

    creating countdown timer in excel no vba

    Hi I am trying to do similar countdown timer (please see the link below) but my problem, when I subtract the target hours from the start hours, the result is negative. The author did not say anything about that. How can I fix that. I also appreciate if you have better idea of doing that. Thank...
  7. W

    Form called by selecting record

    Pearson's form seems missing, or removed. I wrote one using Events. Thought I'd share. Here's the link: https://kvisit.com/OQ/neoB
  8. D

    Close Active window triggers before close event

    I have an excel workbook with 2 views open (View/New Window). When I close the second window (the workbook remains open) it triggers the before close event. Is there anyway of closing the second window with triggering the before close event? I only want the before close event to trigger whe the...
  9. D


    I have a bank of data that is updated monthly. I need to analyze said data to determine first all values above 35 then I need to look for two consecutive instances of this event. Once found, I would like to indicate for inspection if not ok
  10. B

    Power Pivot or Power Query to show all claim lines for a customer with a specific event

    I have a spreadsheet with multiple claim lines per day for various events taking place per customer. I am looking for either a Power Query or Power Pivot solution to show all claim lines for only dates where a particular event took place on one of the claim lines. For example, if customer ID...
  11. A

    Combo box Change Event twice

    When I make a selection using the drop down arrow, the change event executes once. However, if I type 1 character, the change event execute twice. I step through the procedure and I can see the code only execute once until to the end of the procedure and then my cursor changes to a wait circle...
  12. TAPS_MikeDion

    Quick stupid question about "Sub ComboBox1_Click()"

    Since I'm not that well versed in VBA, unlike most on this forum, I was hoping someone could answer a quick question regarding "Sub ComboBox1_Click()". I thought this was a mouse click event, but as I seem to be finding out, it is also a key click event. Is this correct? I'm wondering...
  13. S

    Another Time comparison problem

    So I have thousands of rows of data every day. In column F I have an event code and in column G I have the duration of that event. I need to know if "Event B" occurs within 20 minutes of "Event A". If F2 is "Event A" and G2 is 0:09:23 and F3 is "Event X" and G3 is 0:00:03 and F4 is "Event Y"...
  14. P

    Graphing swimmers' times over time

    Hi, I'm trying to create a graph that compares several swimmers time at different meets. The data is stored as follows: <tbody> Date Swimmer A Swimmer B Swimmer C 1/1/2018 01:53.55 01:50.51 6/5/2018 01:34.22 01:45.12 7/9/2018 01:30.10 01:35.12 </tbody> I know times must be...
  15. J

    Set range for Multiple change events on one sheet each referring to a different range of cells

    1 change event worked on the worksheet until it got too large. I split the 1 event into two events. One titled “Private Sub Worksheet_Change1(ByVal Target As Range)” which I want to work for changes in range E38:H70 The 2nd event “Private Sub Worksheet_Change(ByVal Target As Range)” is for...
  16. K

    Pivot table; show values as percent and total as number

    I have a pivot table with a list of different types of events in the first column (row labels), e.g. boiler repair, floor repair, window repair. The value columns are the days of the week, with the number of each type of event (repair jobs) occurring on each day. I would like to show the grand...
  17. H

    Creating Userform Controls At Runtime

    Good morning I am adding controls at runtime to a userform. I have done this before and I cannot work out what I am doing differently this time. I can add the controls alright and I can add the event handler code in the form module programatically. The form loads alright but the event...
  18. H

    Variable in Textbox Event

    I make a selection in a Userform.Listbox with data coming form the Textbox in a Userform Can I pass a variable to the Textbox Sub ..._Change event ie. Sub TextBx_Change(ByRef ....) I don't want to use a Public variable Thanks
  19. K

    Fire change event for ActiveX combobox

    Hi all, I have an issue with an ActiveX combobox. In my workbook, an activeX combobox is created each time a cell is clicked. I would like to trigger an event so that when the value of the combobox change, it triggers an event that modify the adjacent one. My problem is that, as you know, the...
  20. H

    DatePicker 32 & 64-bit

    I've found a datepicker https://www.dropbox.com/s/at2peyyhttnbvnw/New%20Calendar%20Ver%204.xlsm?dl=0 I tried to find the way to use the " DTINSERT"-knob to use the date in another Procedure There is a timer event which gets activated in the launch code. When you stop the code midway, the timer...

Watch MrExcel Video

This Week's Hot Topics

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