converting number to string

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Try this:

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

HTH,
Bernie
MS Excel MVP
 
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
 
the CSTr worked. Thank you.

-----Original Message-----
Try this:

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

HTH,
Bernie
MS Excel MVP




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top