/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
Getting values from textboxes to variables
Fra : fd


Dato : 05-07-02 21:28

Hi NG

I hope that some can help me.


I'm building a userform in Excel where I have to get data from several
textboxes into a variable called SPEED.
Nw my problem is that I can not get Textbox statment changing, if I instad
of "f = TextBox & j & i" writes "f = TextBox12" it works but I only get the
value of one TextBox. What can I do to get all the values from the userform.


Dim SPEED(10, 25) As Double
Dim f As String
Dim i As Integer
Dim j As Integer


i = 1
j= 1

Do
Do
f = TextBox & j & i
SPEED(j, i) = f
i = i + 1
Loop Until i = 25
j=j+1
Loop Until ((j =10) Or (f=""))


Best,
Casper



 
 
Tom Ogilvy (05-07-2002)
Kommentar
Fra : Tom Ogilvy


Dato : 05-07-02 22:57

Since you said userform

f = useform1.Controls("TextBox" & j & i).Text


Regards,
Tom Ogilvy


fd <dfg@dfs.dfh> wrote in message news:ag4vda$3sf$1@news.cybercity.dk...
> Hi NG
>
> I hope that some can help me.
>
>
> I'm building a userform in Excel where I have to get data from several
> textboxes into a variable called SPEED.
> Nw my problem is that I can not get Textbox statment changing, if I instad
> of "f = TextBox & j & i" writes "f = TextBox12" it works but I only get
the
> value of one TextBox. What can I do to get all the values from the
userform.
>
>
> Dim SPEED(10, 25) As Double
> Dim f As String
> Dim i As Integer
> Dim j As Integer
>
>
> i = 1
> j= 1
>
> Do
> Do
> f = TextBox & j & i
> SPEED(j, i) = f
> i = i + 1
> Loop Until i = 25
> j=j+1
> Loop Until ((j =10) Or (f=""))
>
>
> Best,
> Casper
>
>



Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408522
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste