userform with many Modes..

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
203
On a userform i have these Function's
Combobox1
Labels 1 to 7
Textbox 1 to 10
and Commanbutton 1 to 7

I need the Combobox to Look on Range from Cell ("A1:A127") i get it to work on these Codeline

Code:
Private Sub UserForm_Initialize()'add column of data from spreadsheet to your userform ComboBox
ComboBox1.List = Sheets("Ark3").Range("A1:A127").Value


end Sub
But i can't figure out to get Value from Cell when Combobox1 is Set to "1" then Label1 set value from "B1" and Label2 set value From "D1"
and so on with Combobox1 from 1 to 127 Label1 and Label2 take value from B1 to B127 and D1 to D127

hope that was enough info
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The labels are on userform2
label 1,3,5,7,11 should take value from B1 to B127 Depend on Combobox1
Label 2,4,6,8,12 should take value from C1 to C127 Depend on combobox1
label 9,10 should take value from D1 to D127 Depend on combobox1
I know perfectly well that there are more labes in my #1 post
its because i will in first place ger the first round of the function work
then look how its work and then put the rest into the code line
sorry not for did that in the beginning
 
Upvote 0
I'm about to run out of steam here:

Your original post said:

But i can't figure out to get Value from Cell when Combobox1 is Set to "1" then Label1 set value from "B1" and Label2 set value From "D1"
and so on with Combobox1 from 1 to 127 Label1 and Label2 take value from B1 to B127 and D1 to D127


And you said you had 7 Lables


So if you select first value in ComboBox then the 7 labels captions would be from Row(1)

So if you select second value in ComboBox then the 7 labels captions would be from Row(2)

And on and on for 7 labels.

And I understand first label caption would come from Column B and second label would come from column D and on and on

And that is what my script did.

But you said that did not work
I asked earlier:
Explain exactly what happened and what you want if not what I describe.

And you never answered my question.

If I ask questions I want a answer to my question

Why is it you did not answer my question?


And all you other posts have not helped me understand what you want.
<strike>
</strike>
 
Last edited:
Upvote 0
Her with Pictures

Lxh6cyw
Code:
https://ibb.co/Ky3Qyjw
https://ibb.co/LdjWfmb
https://ibb.co/rwS8V3D
https://ibb.co/rZFtK5v
https://ibb.co/JzX1PZ9
https://ibb.co/27QCHgg
https://ibb.co/Lxh6cyw
 
Last edited:
Upvote 0
Someone else here on the forum may be able to help you.
I asked you several questions several times and you have not answered my questions and just want me to look at images.

I hope someone else will be able to help you.
 
Upvote 0
" Mr Aswer Is This " i Am terrible sorry if i not have given you the Answer you ask for
i have now try and try and try you code and
yes your Code Works ,but not as i want it

your code works okay for Label 1 and Label 2 but not for label 3-7
as i try in #13
Code:
[COLOR=#333333]The labels are on userform2[/COLOR]
[COLOR=#333333]label 1,3,5,7,11 should take value from B1 to B127 Depend on Combobox1[/COLOR]
[COLOR=#333333]Label 2,4,6,8,12 should take value from C1 to C127 Depend on combobox1[/COLOR]
[COLOR=#333333]label 9,10 should take value from D1 to D127 Depend on combobox1[/COLOR]
[COLOR=#333333]I know perfectly well that there are more labes in my [/COLOR][URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1"]#1[/URL][COLOR=#333333] post[/COLOR]
[COLOR=#333333]its because i will in first place ger the first round of the function work [/COLOR]
[COLOR=#333333]then look how its work and then put the rest into the code line[/COLOR]
[COLOR=#333333]sorry not for did that in the beginning[/COLOR]

And yes i know that there now is 12 Labels

Sorry again

and thanks for your Patience with mee
 
Upvote 0
The trouble I'm having is your changing what you want almost every time you post. See here is what you said earlier in a previous post.

If Combobox1 Is set "1 - 127" then Label1 , 3, 5, 7 Read cell "B1 - B127" and Label2 , 4 , 6 , 8 Read cell "C1 - C127"

and Label 9 read from cell "D1 - D127"
and Label 10 read from Cell "E1 - E127"

and so on until 127

But in your latest post you said:

label 1,3,5,7,11 should take value from B1 to B127 Depend on Combobox1

Label 2,4,6,8,12 should take value from C1 to C127 Depend on combobox1

label 9,10 should take value from D1 to D127 Depend on combobox1



See when we write scripts we look for patterns




Like 1,3,5,7

Here we are skipping one number.

so it may be: 1,3,5,7,9,11,13,15 etc.

You have no consistent pattern.

like you have:
2,4,6,8,12

a pattern would be 2,4,6,8,10,12,14

And you keep saying I have many more labels so it's hard to see a relationship to use.

Why you skip some labels is beyond me.

And if you end up with 75 labels and there is no pattern here this could be hard to do for me


 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top