Resolving An Ambiguous Name Error

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,533
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
My code used to work. I don't know now why I am getting a "Compile Error: Ambiguous name detected: ~" with the line highlighted in red below.

Rich (BB code):
Private Sub Worksheet_Change(ByVal target As Range)
'Application.EnableEvents = False
    Dim wshmain As Worksheet
    Dim wshlists As Worksheet
    
    Set wshmain = Worksheets("Main")
    Set wshlists = Worksheets("Lists")
    
    Select Case target.Address(0, 0)
        'call procedure when cell D1 (report date) changes
        Case "D1"   'New Date Entered
            Call Test 'test to determine whether reconciled database exists. Create missing database, or open existing database.

I stepped through the 'Test' sub and didn't receive any errors, so not sure what this is all about.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi Andrew ... yes. I did. Looks like I used the same name for an experimental sub that I didn't delete.
Found the problem.
Had the same sub twice.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,196,260
Messages
6,014,293
Members
441,813
Latest member
elevate

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