![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
First time trying to write a frame with option buttons, keep getting error ambigous name. What I have is
Private Sub optSize_Click(Index As Integer) This is the first line of all 3 click buttons. New at this,I cant figure out what is wrong. Thx Dan |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
HI
To add to Aladins comments Its just VBA clashes with what ever. Fix: Simple change the Sub name to something else, i try to keep simple... BTW the Sub name and the module name can not be the same this will error ... just in case
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Still trying, very much a beginer and trying to learn from a workbook. This is what I have.
Option Explicit Dim PizzaSize As String Dim PizzaCrust As String Dim PizzaWhere As String Private Sub Form_Load() 'Initialize pizza parameters PizzaSize = "Small" PizzaCrust = "Thin Crust" PizzaWhere = "Eat In" End Sub Private Sub optSize_Click(Index As Integer) 'Read pizza size PizzaSize = optSize(Index).Caption End Sub |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
This isn't done in VBA right ? it looks like VB, but not VBA...
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Im in excels 2000 which comes with vba, its probaly not the full blown version
|
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
This just doesn't like VBA
Quote:
|
|
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
the project is under a user form, The opsize is a text box, the codes I copyed, came directely out of my workbook. dont know if where it said (index) is looking for a number or what. Just kind of lost.
|
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Yes, it is looking for a number. Which in theory should represent the index number of the Text box that has been clicked.
Are there any more TextBoxes in there ? I believe more than one have the same name, which would cause the Ambigous name error. |
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Yes I have three text boxs, which I tryed to name them the same name but it wouldnt let me. Wolking on that too !
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|