Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same Value in two textboxes on Click

Status
Not open for further replies.

senators40

Technical User
Jan 7, 2003
68
CA
I would like to do the following procedure in one line - I think it is more effieient, when I click on a Command Button


TextBox1.Text = TextBox3.Text
TextBox2.Text = TextBox3.Text

I tried doing:

TextBox1.Text , TextBox2.Text = TextBox3.Text

but I got an error message Compile Error Invalue Use of Property

I would also like to combine a Range / cell in the excel workbook and Textbox as well.

Any help would be appreciated

Also, if it isn't better from a programming perspective please let me know as well and I will continue to do it the old way

Thanks

Jeff
 
The one line syntax:
TextBox1.Text = TextBox3.Text: TextBox2.Text = TextBox3.Text

The more efficient way (?)
With TextBox3
TextBox1.Text = .Text
TextBox2.Text = .Text
End With

combine a Range / cell in the excel workbook and Textbox
And what is the problem ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
given the nanoseconds you will save on updating 2 textboxes, I really hope that you have rather more than that to update otherwise this is a pretty pointless exercise...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
[lol]

My, my...nanoseconds COUNT Geoff! However, perhaps the time is not the factor but....hmmmm...the content maybe???

Gerry
 
[LOL] at least it shows an actual use for the with statement - other than making code look neater and saving my poor callused fingers !!!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top