Opps..., I did something very bad.....

G

Guest

Guest
when running the main sub from VB, I get this error:

Compile Error:
Ambiguous name detected: Column

What did I do?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,560
Messages
6,120,222
Members
448,951
Latest member
jennlynn

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