application.enableevents

  1. P

    Private Sub Workbook_SheetChange Not Triggering - why?

    Why doesn't this work/trigger? Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Source As Range) Application.EnableEvents = True Application.ScreenUpdating = False If Target.Address <> "$A$1" Then Exit Sub Application.Columns("D:BP").Select...
  2. L

    Posting 2 VBA Codes on One Sheet

    Good morning. I am new to this site and brand new to VBA. Basically I am trying to add 2 codes to the same sheet but I am not doing it correctly as only one code is working. Could someone please help me? These are the 2 codes I am trying to get on the same sheet: #1 Private Sub...
  3. P

    User-Entered Values vs. Calculated Values

    In my spreadsheet, the user has an initial option (Cell = F8) to select "Grouped" or "Separated" from a drop-down list. There is a table in the worksheet that changes depending upon which option is selected. That part was easy. What's tricky is that if F8 = "Grouped", the data column's (G18:G28)...
  4. L

    Copy Only Value's Cell

    Hi there, I needed to copy the cell's value to another cell (in another sheet creating a list) whenever this same cell changed its value. I've created a simple code that works but it copies all things from this specific cell that I only want its content and this is causing me problems with...
  5. O

    Run time error 424 (Object Required)

    Hey all, I am having trouble with this code.The red highlighted line is giving me a Run Time Error 424 (Object Required) Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Application.EnableEvents = False Worksheets("HSheet").[B3] = Worksheets("HSheet").[B2]...
  6. F

    Recording Cell Value

    Hi all, I have just used the following code, from this forum (Someone called Alan - Thanks Alan whoever you are!!), that does what I'm looking for. My only problem is, the code works fine if the data I enter into A1 is manual. But if the value in A1 in coming from elsewhere in the sheet, I...
  7. M

    Multiple Comboboxes

    Hi, I Have three comboboxes called "År", "Månad" And "Dag". I want "Dag" depend on the values from the other two comboboxes. The first code works for "Dag" depending on "År", then I added an And statement to include "Månad" but after that it doesnt work. Anyone knows what the error is...
  8. Anne Troy

    Subtract X hours from entered value

    In a cell called offtime, I will enter 2 or 3, depending on the time of year. This indicates that I (on the east coast) am 2 or 3 hours later than the time in Phoenix AZ. In my worksheet column K, I will enter the east coast time. I want it to auto-change my entry by deducting the value in the...
  9. D

    How to close the one workbook if I have multiple workbooks open?

    Hi Team, Happy Friday! I am using following VBA code to close only the workbook I am working on, but this code closes all workbooks which have been opened. Any idea, please. Dim WbCount As Integer, ii As Integer WbCount = Workbooks.count If WbCount > 1 Then For ii = WbCount To 1 Step...
  10. J

    Struggling with Application.EnableEvents

    First time poster, and let me apologize right off the bat if I'm asking a question that has already been answered. I've tried searching for an answer but haven't found what I need yet. I'm also a first-timer to VBA as I'm finishing up my first project. I don't really know coding that well but...
  11. wrightyrx7

    Worksheet change - Target.Column - problem

    Hi all, I have a problem and I cant get my head round how to fix it. Basically i have 2 columns with dates in, and i need the dates to be formatted correctly otherwise is messes up some of my formula's. So if the date contains "." or "-" i replace them with "/" If Target.Column = 1 Or...
  12. D

    Combining Code and slight modification

    Good morning all! I am hoping you can help me as I am lost on exactly how to accomplish what I want. I have several VBA codes that do different things that I would like to combine if possible. First I have a 2 codes that add a comment to a cell when the cell’s value is changed. One code...
  13. 2

    Time stamp for record entry only but not record change

    Hi all, What I have below stamps the date+time for new entry or change of value. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then Application.EnableEvents = False Cells(Target.Row, 8).Value = Date + Time Application.EnableEvents = True End If End Sub What do I...
  14. D

    Change code so it also prevents special characters being entered

    Hi, I have this code that I would like to alter so it prevents the so called special characters as well as numbers being entered into my range. Special characters being !"£$%^&*()_+=-{}][:@~#';<>?/.,|\`¬ and so on. If Target.Column <> 5 Then Exit Sub Dim cell As Range...
  15. H

    Clear Cell Based on Another Cell Value

    Im trying to Clear a value in "A3:A120" in sheet named (CSA1) if the value of Cell L2 in Sheet named (RESULTS) = "YES". I found the following Solution that Will only clear the cells if the YES is in cell L2 in CSA1 Sheet and tired to use to to pull the YES from the RESULTS SHEET: The Below is...
  16. H

    VBA TRUE/FALSE help

    I am using a Macro I pulled offline to timestamp certain cells when changed Is there a way to alter this macro so that it works if instead of looking for any value and blank values, it will add a date/time if TRUE is inputted in O11 and clears it if O11 is FALSE? Any help would be appreciated...
  17. G

    VBA Runtime error

    Hello Everyone, Here is my code: What I'm trying to do under VBA is when J5 = NO, change M5 to 0. That I can accomplish. However if I do add that code, the proceeding hide rows gives me the run time 1004 error: Unable to set the hidden property of the Range Class However if I remove the...
  18. M

    Altering code from Worksheet_Change so that Undo works

    Hi, I posted a question about this earlier, but have discovered a little bit more on my own and have run into a different problem. With the following code, the Undo function is effectively removed. Do I have any options for replicating this code but not making it a worksheet change dependent...
  19. T

    Infinite loop

    If I step into this code, it seems to be stuck in an infinite loop, yet if I run it, it's fine: Option Explicit Private Sub cmbGraph_Change() Me.cmbGraph.Clear Me.cmbGraph.List = Array("a", "b", "c") Application.EnableEvents = False Me.cmbGraph.ListIndex...
  20. L

    Application.CutCopyMode = xlCopy Does Not Retain Value

    I have an odd issue where the underlying VBA in my "WorkSheet" Code does not retain the value of a "Copy" after pasting to a cell. Subsequently - I am unable to utilize the qat "UNDO" shared control as the copy value always reverts to Application.CutCopyMode = False immediately after pasting -...

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