converting number to string

G

Guest

I am using VB in Excel and have this follwing formula
which is giving me problems.

As far as I understand of VB the varible qty has to be
interger to add, but I think it needs to be a string for
the value to be combined with the other text to form the
control source. I may be way off base here, but I think I
am close. Please help. Thank you.


Dim qty As Integer
cc = TextBox11.Value
qty = (10 + ((cc - 1) * 14))
TextBox12.ControlSource = "Scrinput!b" + qty
 
B

Bernie Deitrick

Try this:

TextBox12.ControlSource = "Scrinput!b" + CStr(qty)

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

I should have also noted that changing the controlsource through code
doesn't "stick" ....It will revert to the value from design time when
you unload the userform.

HTH,
Bernie
MS Excel MVP
 
Top