application.enableevents

  1. J

    Issue with Duplicate Const & Dim Changed As Range

    Hi, Trying to get these two instances to run together but not sure how to simplify. Can provide any more information if needed. Private Sub Worksheet_Change(ByVal Target As Range) Dim Changed As Range Const YesCol As String = "L" ' Set Changed = Intersect(Target...
  2. davewatson86

    ActiveWorkbook.UpdateLink issue

    Hi all having an issue where i run the below code: Sub UpdateLinks() Dim Location As Variant Dim File_Name As String Application.ScreenUpdating = False Application.EnableEvents = False Call unprotect For i = 5 To WS_Admin.Range("C4").End(xlDown).Row File_Name =...
  3. I

    Ucase code for specific range

    Hi, I have the code shown below which changes small case to upper case. Private Sub Worksheet_Change(ByVal Target As Range)If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub On Error Resume Next If Not Intersect(Target, Range("G13:O51")) Is Nothing Then...
  4. I

    Run Time Error 13 Type Mismatch

    Evening, After i print my invoice i then use a button to clear the cells on my worksheet.. This is the code that is used on the button. Private Sub Clear_Invoice_After_Printing_Click() Dim strFileName As String strFileName = "C:\Users\Ian\Desktop\REMOTES ETC\DR COPY INVOICES\" &...
  5. S

    VBA - When Cell Change, Get the Value in that cell and Rename an Existing Worksheet

    Need some help here, guys. Not a VBA pro, and I have tried my best to amend it but just couldn't solve it. I have 2 worksheets in my XLSM. Worksheet 1 is Taylor. Worksheet 2 is Overall. I want to rename Taylor worksheet based on a dynamic value enter in Overall worksheet cell E6 and append...
  6. R

    VBA question

    Hi All I am using this code and the target range represents 1 layout of 72 cells. I need to include 23 more layouts. My question: should I cram it all in 1 target range or should I duplicate this code for each layout? If Not Intersect(Target...
  7. M

    Wanting to sort column using VBA

    So I have a command button that when clicked, I would like to sort a cell range in a worksheet. For some reason, my cells are not sorting using my code below. Any suggestions? Sheets("Formula Data").Range("I2").Value = rowNum1 Sheets("Formula Data").Range("I3").Value = rowNum2 Sheets("Formula...
  8. Trevor3007

    speed up code?

    good morning , Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A:A")) Is Nothing Then If Target.Count > 1000 Then Exit Sub For Each c In Target If LCase(c.Offset(0, 1).Value) = LCase("Matched Assets") Then...
  9. MFish

    Worksheet change VBA Code not working

    Code: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("D2:D10000")) Is Nothing Then Exit Sub Application.EnableEvents = False With Target .Offset(0, -2).Value = Date .Offset(0, -1).Value = time .Offset(0, -3).Value = Environ("Username") End With...
  10. H

    Last Updated Worksheet Date/Time

    Hi there - I had https://www.mrexcel.com/forum/members/jmacleary.html kindly post some code a while ago. Unfortunately the code intermittently stops working. Does anyone have any ideas why? Basically the code is to update the date/time a particular range was last updated/changed. Cheers, H...
  11. J

    Worksheet change offset BUT ignore if offset value exists

    I have a worksheet change macro that both updates an offset cell value with a date & a selection of cells with corresponding offset dates, however I am trying to update it so that it only inputs date if the offset cell is blank. Here is the code that works: Private Sub Worksheet_Change(ByVal...
  12. Leicester City Fox

    VBA Code now working on full colum multiple selecton Drop-down

    The VAB Code below Work but I only want it in two column numbers 20 (T) and 23 (W) but its applying it to all columns I just want on these two. Private Sub Worksheet_Change(ByVal Target As Range) Dim Oldvalue As String Dim Newvalue As String Application.EnableEvents = True On Error GoTo...
  13. E

    Private Sub - range for every sencond column

    Hej guys. I have this little problem. I would like to make it the same for every second row, but i cant figure out how to set the range correctly. I want to type "x" in a random cell i column D or F, and the timesample will emerge one the cell to the right. Private Sub Worksheet_Change(ByVal...
  14. P

    Macro Stops Empty cell

    After I add new rows to table, the code will not work on target cell unless it has something in it. I'm using a Vlookup from another sheet source to automatically add the letter to Column "P" Option Explicit Sub Macro1() Application.EnableEvents = False Dim lngLastRow As Long Dim...
  15. Trevor3007

    worksheet selects all after VB triggers?

    hi, I use the following code:- Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub On Error Resume Next If Not Intersect(Target, Range("z4:z100")) Is Nothing Then Application.EnableEvents = False...
  16. B

    speed up vba macro

    im trying to speed up my vba macro. i optimized my code as best i can. removed 99% .select .copy .paste etc turned what i can into with ws1 .bla .bla .bla end with code is 1000 times neater but if anything runs slower... i then found this code below...
  17. B

    Help with a macro please

    Hi Everyone, I'm running the following Macro that inserts a formula into a cell based on the population of another cell on the same sheet. I need to edit the "Target, Range" to Sheet "Import", Cells B:B and can't get it figured out. Any Help would be appreciated. Thank you! Private Sub...
  18. M

    Worksheet Change code

    I have 2 slicers running a pivot table on a sheet called "Entry Form" Slicer 1 is controlling a named cell called "CEF_Entry" Slicer 2 is controlling a named range called "CEF_Type" I would like it that when I change slicer 1 it clears Slicer 2' selection and locks my entry form requiring a...
  19. B

    Worksheet_Change Event and undo

    Does anyone know how to keep the undo along with worksheet change event. Here is my code that I am using. Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range 'TRACKS DATE ENTRY WAS MARKED AS COMPLETE AND WHO UPDATED IT If Target.Column = 21 Then...
  20. Ironman

    Basic error in my code that I'm unable to identify

    Hi There's something in my below code that causes the workbook to hang either during or immediately after the named procedures run and I strongly suspect the cause is either in the first or last 4 rows. Private Sub Worksheet_Change(ByVal Target As Range) CALC = Application.Calculation...

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