![]() |
![]() |
|
|||||||
| 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 |
|
Guest
Posts: n/a
|
when running the main sub from VB, I get this error:
Compile Error: Ambiguous name detected: Column What did I do? |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Post you're code and I'm sure someone will help you (your error is coming from the word "Column" somewhere in your code).
-rh |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
|
it's probably got something to do with VBA using the word Column and you may have used it as a variable name or something.
Then again maybe not, post the code and it will be easier to spot.
__________________
Regards, Gary Hewitt-Long |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
Here's the code. I hope you can help. Thanks
Private Sub Addcol_Click() 'activate schedules Sheets("COLTEMPLATE").Activate 'declare variables colmark = colmark.Value truewitdh = truewidth.Value truedepth = truedepth.Value tcol = tcol.Value coltype = coltype.Value bcol = bcol.Value tiesize = tiesize.Value tiespacing = tiespacing.Value lt9 = lt9.Value 'this is the qty multiplier st9 = st9.Value 'this is the qty multiplier vrtqty = vrtqty.Value barsize = barsize.Value detwidth = detwidth.Value detdepth = detdepth.Value 'set borders for schedule b = barsize.Column(2) c = barsize.Column(3) h = barsize.Column(5) k = barsize.Column(6) d = tcol * 12 - bcol * 12 - 2 - k o = barsize.Column(7) - 120 + tcol * 12 - COL clearance = barsize.Column(8) 'send values to colunm schedules Sheets("COLTEMPLATE").Range("iv20").End(xlToLeft).Offset(0, 1).Value = colmark Sheets("COLTEMPLATE").Range("iv22").End(xlToLeft).Offset(0, 1).Value = truewidth Sheets("COLTEMPLATE").Range("iv23").End(xlToLeft).Offset(0, 1).Value = truedepth Sheets("COLTEMPLATE").Range("iv29").End(xlToLeft).Offset(0, 1).Value = bcol Sheets("COLTEMPLATE").Range("iv24").End(xlToLeft).Offset(0, 1).Value = tcol Sheets("COLTEMPLATE").Range("iv30").End(xlToLeft).Offset(0, 1).Value = tiesize Sheets("COLTEMPLATE").Range("iv31").End(xlToLeft).Offset(0, 1).Value = tiespacing Sheets("COLTEMPLATE").Range("iv32").End(xlToLeft).Offset(0, 1).Value = lt9 Sheets("COLTEMPLATE").Range("iv33").End(xlToLeft).Offset(0, 1).Value = st9 Sheets("COLTEMPLATE").Range("iv34").End(xlToLeft).Offset(0, 1).Value = b Sheets("COLTEMPLATE").Range("iv35").End(xlToLeft).Offset(0, 1).Value = c Sheets("COLTEMPLATE").Range("iv36").End(xlToLeft).Offset(0, 1).Value = d Sheets("COLTEMPLATE").Range("iv37").End(xlToLeft).Offset(0, 1).Value = h Sheets("COLTEMPLATE").Range("iv38").End(xlToLeft).Offset(0, 1).Value = k Sheets("COLTEMPLATE").Range("iv39").End(xlToLeft).Offset(0, 1).Value = o Sheets("COLTEMPLATE").Range("iv27").End(xlToLeft).Offset(0, 1).Value = detwidth Sheets("COLTEMPLATE").Range("iv28").End(xlToLeft).Offset(0, 1).Value = detdepth Sheets("COLTEMPLATE").Range("iv25").End(xlToLeft).Offset(0, 1).Value = vrtqty Sheets("COLTEMPLATE").Range("iv26").End(xlToLeft).Offset(0, 1).Value = barsize Sheets("COLTEMPLATE").Range("iv21").End(xlToLeft).Offset(0, 1).Value = coltype Range("B1:b18").Select Selection.Copy Sheets("COLTEMPLATE").Range("iv1").End(xlToLeft).Offset(0, 1).Select ActiveSheet.Paste colmark.SetFocus End Sub Private Sub barsize_Change() b = barsize.Column(2) c = barsize.Column(3) h = barsize.Column(5) k = barsize.Column(6) d = tcol * 12 - bcol * 12 - 2 - k o = d + b + k End Sub Private Sub Cancel_Click() Unload Me ActiveWindow.WindowState = xlMaximized End Sub Private Sub laps_Click() changelap.Show End Sub Private Sub truedepth_Change() detdepth = truedepth.Value - 3 End Sub Private Sub truewidth_Change() detwidth = truewidth.Value - 3 End Sub |
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
I think your error is in the line:
barsize = barsize.Value It appears that barsize is the name of a control on your form or spreadsheet. Try renaming barsize (the variable) to something else in this line and in the line where you set something equal to barsize. If this doesn't work, you could send me a copy of your workbook and I could take a look. Hope this helps, Russell |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|