worksheet_changebyval

  1. P

    Do things based on previously active cell

    I have the following code: Private Sub Worksheet_Change(ByVal Target As Range) If Range("W2") <= Range("W1") Then If Not Intersect(Target, Range("A:U")) Is Nothing Then Call Automatic_Highlights Else End If End If End Sub Which Calls the following: Sub Automatic_Highlights() Dim TargetCell As...
  2. T

    Run macro when enter key is pressed

    Hi I would like a Sub to run every time the number in a particular cell changes. Could someone help me with the syntax? The follwing does not work: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address(False, False) = "M3" Then Call Search End Sub Thanks in advance
  3. L

    Allowing separate Macro onto same worksheet per cell values?

    I am very green with Macros. I have a worksheet where a Macro is being used to hide or unhide a separate worksheet based on a dropdown value in a particular cell. My issue is, I need to do this to a 2nd drop down that will hide or unhide a separate worksheet from the previous as well. I am not...
  4. W

    How to concatenate two subs Worksheet_change

    Hi everyone, I have a file in which I inserted a sub Worksheet_change that automatically transforms the user input (in this case only the names and surnames of members) in capital letters. Private Sub Worksheet_Change(ByVal Target As Range) ''''''''''''''''''''''''''''''''''''''''''''...
  5. R

    Save Delay

    I have the following code. Is it possible to delay the save by a minute? so once the change is made to the cells it will save the workbook a minute later? Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range("K6:k8800"), Target) Is Nothing Then ActiveWorkbook.Save If Not...
  6. C

    Archive from a table

    Hi, I want to archive some items which are in a table when I set their status to "complete". In my test workbook it orks fine using this code. Private Sub Worksheet_Change(ByVal Target As Range) Dim Changed As Range Const YesCols As String = "M" '<- Your 'completed' columns...
  7. F

    Auto Format locked cells

    Hi I want to adapt the code below so when the cell has locked after some input the background changes colour The code is Worksheet. Change Private sub worksheet_change(byval target as range) Activesheet.unprotect password:=“blablabla” Target.locked = true Activesheet.protect password :=...
  8. C

    VBA - Do action if table changes

    Hi, I am working on a (seemingly) simple macro wich should look if my "Tabelle1" is changed. If yes, it should do something. This is my macro, but I get a Runtime error 424, what am I doing wrong? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count <> 1 Then Exit Sub...
  9. H

    Two Worksheet_Change on same Worksheet

    Hi, I have two different change events I'd like to run on the same sheet. I'm having trouble having the second one run. Here's the first change: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("C3")) Is Nothing Then Exit Sub Application.CutCopyMode = False...
  10. V

    How do you stitch two or more macros together?

    I have two macros I want to stitch together. Both on the bottom. How do you stitch them together? Is there an easy How-do somewhere? Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next Range("A1").Sort Key1:=Range("A2"), _ Order1:=xlDescending, Header:=xlYes...
  11. J

    VBA-Excel. How can I handle hide/unhide rows based on Private Sub Worksheet_Change(ByVal Target As Range)?

    Good morning to all, I am a newbie in macros & VBA Excel. I wish to handle hide/unhide rows based on Private Sub Worksheet_Change(ByVal Target As Range). I have the following code event Private Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.Unprotect Password:="avalon" If...
  12. B

    Worksheet_Change(ByVal Target As Range) - Two Condition

    I have dropdowns in Cells(44,1) and Cells(44,6) with simple values of Yes or No I am attempting to do a ByVal but I need allow the user to select in any order - meaning changing the value of Cells(44,6) first and Cells(44,1) second and vice versa. I have tried AND in my statements as well and...
  13. A

    Combobox Sub Worksheet_Change(ByVal Target As Range)

    hi All I need help on the following I have a combobox on sheet and I want it to fill when a value change on range b1 let me explain you Sub Worksheet_Change(ByVal Target As Range)<strike></strike> If range b1 a text A then combobox would fill with AA,BB,CC If range b1 a text B then...
  14. M

    Excel VBA error Ambiguous Name detected: Worksheet_Change

    I just want my 3 pivot tables to automatically refresh. I'm not sure why I keep getting this. I made sure that the data sheet is named correctly as well as all three pivot tables. Can someone help please? Private Sub Worksheet_Change(ByVal Target As Range)...

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