#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the string

i hope you understand my question
thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Strings

In Excel 2000 VBE want's str as Object
And needs the Set instruction

Dim str As Object

Set str = UserForm1.CheckBox1
str = 1
UserForm1.Show


I don't know how to make it work from a string
--
steveB

Remove "AYN" from email to respond
"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the
string

i hope you understand my question
thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Strings

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the

string

i hope you understand my question
thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method "controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the

string

i hope you understand my question
thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Strings

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method "controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the

string

i hope you understand my question
thanks








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method "controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the
string

i hope you understand my question
thanks






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method "controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the
string

i hope you understand my question
thanks






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Strings

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method

"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that

with the
string

i hope you understand my question
thanks








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Sorry but i have translateproblems
i think maybe subroutine is better
like this

Private Sub Exempl()
str = "Run"

and then to start run
End Sub

Private Sub Run()

End Sub


"Bob Phillips" wrote:

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method

"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that

with the
string

i hope you understand my question
thanks









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Strings

Aran,

Perhaps I have also <vbg

What I mean is that you could easily just drop that code into a
macro/procedure/subroutine whatever you wish to call it, but all of these
need something to trigger them, that is to get them to run. What is it that
you want to do to this code to run?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry but i have translateproblems
i think maybe subroutine is better
like this

Private Sub Exempl()
str = "Run"

and then to start run
End Sub

Private Sub Run()

End Sub


"Bob Phillips" wrote:

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method

"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run

that
with the
string

i hope you understand my question
thanks













  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Hello Bob

I have a ComboBox and when i select a value i read the value
and like to call the subroutine like this

CentralComboBox_Change()
Dim str as string
str =CentralComboBox.Value
' and if i select Centralval1 i like that to run
' and if i select Centralval2 i like that to run

End Sub

Private Sub CentralVal1()
' do things
End Sub

Private Sub CentralVal2()
' do other things
End Sub




"Bob Phillips" wrote:

Aran,

Perhaps I have also <vbg

What I mean is that you could easily just drop that code into a
macro/procedure/subroutine whatever you wish to call it, but all of these
need something to trigger them, that is to get them to run. What is it that
you want to do to this code to run?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry but i have translateproblems
i think maybe subroutine is better
like this

Private Sub Exempl()
str = "Run"

and then to start run
End Sub

Private Sub Run()

End Sub


"Bob Phillips" wrote:

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method
"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run

that
with the
string

i hope you understand my question
thanks












  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Hello Bob
This is how i mean
the combobox have three choises

Private Sub CentralComboBox_Change()
Dim str As String
str = CentralComboBox.Value
' and for ex. the value is CentralVal2
' will run CentralVal2
' how to do???
End Sub

Private Sub CentralVal1()
'do something
End Sub

Private Sub CentralVal2()
'do something else
End Sub

Private Sub CentralVal3()
'do something else
End Sub

"Bob Phillips" wrote:

Aran,

Perhaps I have also <vbg

What I mean is that you could easily just drop that code into a
macro/procedure/subroutine whatever you wish to call it, but all of these
need something to trigger them, that is to get them to run. What is it that
you want to do to this code to run?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry but i have translateproblems
i think maybe subroutine is better
like this

Private Sub Exempl()
str = "Run"

and then to start run
End Sub

Private Sub Run()

End Sub


"Bob Phillips" wrote:

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method
"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run

that
with the
string

i hope you understand my question
thanks












  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

Hello Bob
What i want to do is

I have one combobox where i can chose a value
i then use combobox linkedcell to get a number
the other subroutines have i named choice1, choice2, and so on
when that is done i like to run the subroutine that match the value
of the other subroutines
i have named them choice1, choice2, and so on
that subroutine runs another where i use the code you helped me with

Private Sub CentralComboBox_Change()
'
End Sub
Private Sub CentralVal1()
'here i call other sub's
End Sub
Private Sub CentralVal2()
'here i call other sub's
End Sub


"Bob Phillips" wrote:

Aran,

Perhaps I have also <vbg

What I mean is that you could easily just drop that code into a
macro/procedure/subroutine whatever you wish to call it, but all of these
need something to trigger them, that is to get them to run. What is it that
you want to do to this code to run?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry but i have translateproblems
i think maybe subroutine is better
like this

Private Sub Exempl()
str = "Run"

and then to start run
End Sub

Private Sub Run()

End Sub


"Bob Phillips" wrote:

Aran,

What exactly do you mean by running a function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Hello
I find out how to do
ActiveSheet.OLEObjects(str).Visible = True
worked fine

but i still have the question about how to run a funktion


"aran" wrote:

Thanks
Thats worked fine with the value but if i try visible it say that
the method is not supported

And if i like to run a funktion the same way how do i do



"Bob Phillips" wrote:

No problems Aran, just making sure.

I Assumed userform checkbox.

If it is a control toolbox checkbox, use

ActiveSheet.OLEObjects(str).Object.Value = True

If it is a forms checkbox, use

ActiveSheet.CheckBoxes(str).Value = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"aran" wrote in message
...
Sorry about my example

i have the checkboxes on a worksheet
and when i try your example it say it cant find the method
"controls"

"Bob Phillips" wrote:

Me.Controls(str).Value = True


BTW you cannot set a checbox value to 10, just True or False.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Aran" wrote in message
...
Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run

that
with the
string

i hope you understand my question
thanks












  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Strings

test 4 to post
Hello Bob
What i want to do is

I have one combobox where i can chose a value
i then use combobox linkedcell to get a number
the other subroutines have i named choice1, choice2, and so on
when that is done i like to run the subroutine that match the value
of the other subroutines
i have named them choice1, choice2, and so on
that subroutine runs another where i use the code you helped me with

Private Sub CentralComboBox_Change()
'
End Sub
Private Sub CentralVal1()
'here i call other sub's
End Sub
Private Sub CentralVal2()
'here i call other sub's
End Sub


"Aran" wrote:

Hello
I have a question about strings
How do i make the value runnable
ex.
str = "checkbox1"
and i like to use the string instead of the name checkbox1
and do this
checkbox1.value = 10

or if the string contain a name of a funktion how to run that with the string

i hope you understand my question
thanks

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
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
How to find number of pairs of strings from list of strings? greg_overholt Excel Worksheet Functions 5 January 27th 06 10:42 PM
How can I count strings within strings Paul W Excel Worksheet Functions 4 June 14th 05 12:39 PM
Finding strings within strings Rod[_6_] Excel Programming 1 December 2nd 03 05:34 PM
Finding strings within strings Rod[_6_] Excel Programming 1 December 2nd 03 05:19 PM


All times are GMT +1. The time now is 01:35 PM.

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

About Us

"It's about Microsoft Excel"