Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default converting number to string

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default converting number to string

Try this:

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

HTH,
Bernie
MS Excel MVP

wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default converting number to string

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

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Try this:

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

HTH,
Bernie
MS Excel MVP

wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default converting number to string

the CSTr worked. Thank you.


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

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

HTH,
Bernie
MS Excel MVP

wrote in message
...
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



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default converting number to string

Try this :
TextBox12.ControlSource = "Scrinput!b" & qty


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default converting number to string

Try it with an ampersand "&"

TextBox12.ControlSource = "Scrinput!b" & qty



wrote in message ...
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting string to number kenppy New Users to Excel 9 March 5th 10 07:18 PM
Converting a string into a number format Albert Excel Discussion (Misc queries) 1 April 17th 08 10:18 AM
Converting string of letters to Number sebkavam Excel Discussion (Misc queries) 6 July 26th 06 10:50 PM
Extracting a number from a string and converting it into an Intege Sumeet Benawra Excel Worksheet Functions 2 May 10th 06 10:07 AM
converting number string to number with decimal rortiz Excel Worksheet Functions 2 September 15th 05 08:34 PM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"