Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this :
TextBox12.ControlSource = "Scrinput!b" & qty --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting string to number | New Users to Excel | |||
Converting a string into a number format | Excel Discussion (Misc queries) | |||
Converting string of letters to Number | Excel Discussion (Misc queries) | |||
Extracting a number from a string and converting it into an Intege | Excel Worksheet Functions | |||
converting number string to number with decimal | Excel Worksheet Functions |