Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 18th, 2003, 01:21 PM
jbento jbento is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Aurora, Co
Posts: 15 jbento User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 56 sec
Reputation Power: 0
Question Compile Error: Ambiguous name detected: Worksheet_Activate

All,
I have a routine I would like to break up in Excel - XP version.

I keep getting the following error: Compile Error: Ambiguous name detected: Worksheet_Activate, when I breat it up.

Here is what I am doing:

Private Sub Worksheet_Activate()
[inv1].Font.ColorIndex = [inp1].Font.ColorIndex
[inv1].Interior.ColorIndex = [inp1].Interior.ColorIndex
[inv2].Font.ColorIndex = [inp2].Font.ColorIndex
[inv2].Interior.ColorIndex = [inp2].Interior.ColorIndex
[inv3].Font.ColorIndex = [inp3].Font.ColorIndex
[inv3].Interior.ColorIndex = [inp3].Interior.ColorIndex
[inv4].Font.ColorIndex = [inp4].Font.ColorIndex
[inv4].Interior.ColorIndex = [inp4].Interior.ColorIndex
[inv5].Font.ColorIndex = [inp5].Font.ColorIndex
[inv5].Interior.ColorIndex = [inp5].Interior.ColorIndex
[inv6].Font.ColorIndex = [inp6].Font.ColorIndex
[inv6].Interior.ColorIndex = [inp6].Interior.ColorIndex

End Sub

Private Sub Worksheet_Activate()
[inv1a].Font.ColorIndex = [inp1a].Font.ColorIndex
[inv1a].Interior.ColorIndex = [inp1a].Interior.ColorIndex
[inv2a].Font.ColorIndex = [inp2a].Font.ColorIndex
[inv2a].Interior.ColorIndex = [inp2a].Interior.ColorIndex
[inv3a].Font.ColorIndex = [inp3a].Font.ColorIndex
[inv3a].Interior.ColorIndex = [inp3a].Interior.ColorIndex
[inv4a].Font.ColorIndex = [inp4a].Font.ColorIndex
[inv4a].Interior.ColorIndex = [inp4a].Interior.ColorIndex
[inv5a].Font.ColorIndex = [inp5a].Font.ColorIndex
[inv5a].Interior.ColorIndex = [inp5a].Interior.ColorIndex
[inv6a].Font.ColorIndex = [inp6a].Font.ColorIndex
[inv6a].Interior.ColorIndex = [inp6a].Interior.ColorIndex
[inv7a].Font.ColorIndex = [inp7a].Font.ColorIndex
[inv7a].Interior.ColorIndex = [inp7a].Interior.ColorIndex

End Sub

I am using Excel in Office XP.

I hope someone can help me with this.

Any help will be appreciated.

Thanks,

Reply With Quote
  #2  
Old October 18th, 2003, 07:59 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,976 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 17 h 59 m 48 sec
Reputation Power: 802
You have two worksheet_activate() subs, that's the problem.

Reply With Quote
  #3  
Old October 18th, 2003, 08:24 PM
jbento jbento is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Aurora, Co
Posts: 15 jbento User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 56 sec
Reputation Power: 0
Compile Error: Ambiguous name detected: Worksheet_Activate

Doug,
Somebody helped me solve the problem with the following:

Private Sub Worksheet_Activate()
Call Worksheet_Activate_Part1
Call Worksheet_Activate_Part2
End Sub

Private Sub Worksheet_Activate_Part1()
[inv1].Font.ColorIndex = [inp1].Font.ColorIndex
[inv1].Interior.ColorIndex = [inp1].Interior.ColorIndex
End Sub

Private Sub Worksheet_Activate_Part2()
[inv1a].Font.ColorIndex = [inp1a].Font.ColorIndex
[inv1a].Interior.ColorIndex = [inp1a].Interior.ColorIndex
End Sub

Thanks for responding

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Compile Error: Ambiguous name detected: Worksheet_Activate


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT