Worksheet_Change Does Not Run

ramohse

Board Regular
Joined
Sep 30, 2013
Messages
50
Hello


I am writing a macro to find-replace certain values in formulas on a dashboard based on the value in a drop-down menu. This is built from similar code I have used before. However when I change the drop-down value, try to run the macro from the VBE window, or try to debug nothing happens. When I press F5 in the VBE window the macro list dialog window pops up and no macros are visible. Here is the code:

Code:
Option Explicit
Private Sub Worksheet_Change1(ByVal Target As Excel.Range)
Dim rng As Range
Dim Ws As Worksheet
Dim OldTab As String
Dim NewTab As String
 
Set rng = ThisWorkbook.Worksheets("Dashboard").Range("BusinessUnit")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) Is Nothing Then Exit Sub
 
OldTab = ThisWorkbook.Worksheets("Key").Range("selOldTab").Value
NewTab = ThisWorkbook.Worksheets("Key").Range("selNewTab").Value
 
ThisWorkbook.Worksheets("Dashboard").Range("B9:H35").Replace OldTab, NewTab
 
    ThisWorkbook.Worksheets("Key").Range("selNewTab").Copy
    ThisWorkbook.Worksheets("Key").Range("selOldTab").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

End Sub

Application events are on, so it is not that. Any help or advice would be greatly appreciated. Thank you.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You can create a break in the code right at the beginning (after declaring your variables) and then step through it from there.
 
Upvote 0
Thank you for the quick response.

I created a break point at "Set rng = ThisWorkbook.Worksheets("Dashboard").Range("BusinessUnit")" but when I try to either step through or run it still won't do anything except "ping" at me and/or open the macro dialog window...
 
Upvote 0
It's Worksheet_Change not Worksheet_Change1.
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

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