Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Select Text in TextBox

I have a userform with four text boxes. When a user activates the Enter event
for any text box my code places a certain value in that box. That part works
fine, however I want it to also select the text once it is entered
programmatically. THAT part does not work, no matter what I have seemed to
try.

Private Sub py4_Enter()
'Change text then....
with py4
..selstart = 0
..sellength = len(.text)
..setfocus
end with
end sub


even moving the setfocus or REmoving it helped none. Am I missing something
simple here?


--
When you lose your mind, you free your life.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Select Text in TextBox

Works in my limited test. What does
'Change text then....
do?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in message
...
I have a userform with four text boxes. When a user activates the Enter

event
for any text box my code places a certain value in that box. That part

works
fine, however I want it to also select the text once it is entered
programmatically. THAT part does not work, no matter what I have seemed to
try.

Private Sub py4_Enter()
'Change text then....
with py4
.selstart = 0
.sellength = len(.text)
.setfocus
end with
end sub


even moving the setfocus or REmoving it helped none. Am I missing

something
simple here?


--
When you lose your mind, you free your life.



  #3   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Select Text in TextBox

it loops through the other textboxes adds their values together, then
subracts that amount from a given total. THen plugs that amount into the text
box that was just clicked. The looping does not in anyway setfocus or select
the textboxes being read.
--
When you lose your mind, you free your life.


"Bob Phillips" wrote:

Works in my limited test. What does
'Change text then....
do?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in message
...
I have a userform with four text boxes. When a user activates the Enter

event
for any text box my code places a certain value in that box. That part

works
fine, however I want it to also select the text once it is entered
programmatically. THAT part does not work, no matter what I have seemed to
try.

Private Sub py4_Enter()
'Change text then....
with py4
.selstart = 0
.sellength = len(.text)
.setfocus
end with
end sub


even moving the setfocus or REmoving it helped none. Am I missing

something
simple here?


--
When you lose your mind, you free your life.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Select Text in TextBox

So does anything get selected?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in message
...
it loops through the other textboxes adds their values together, then
subracts that amount from a given total. THen plugs that amount into the

text
box that was just clicked. The looping does not in anyway setfocus or

select
the textboxes being read.
--
When you lose your mind, you free your life.


"Bob Phillips" wrote:

Works in my limited test. What does
'Change text then....
do?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in

message
...
I have a userform with four text boxes. When a user activates the

Enter
event
for any text box my code places a certain value in that box. That part

works
fine, however I want it to also select the text once it is entered
programmatically. THAT part does not work, no matter what I have

seemed to
try.

Private Sub py4_Enter()
'Change text then....
with py4
.selstart = 0
.sellength = len(.text)
.setfocus
end with
end sub


even moving the setfocus or REmoving it helped none. Am I missing

something
simple here?


--
When you lose your mind, you free your life.






  #5   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Select Text in TextBox

absolutely nothing gets selected. thank you but I found out i had a better
way to accomplish the desired ends, still can't highlight, but since i
couldn't get it working i just programmed something else. Thank you however
Ben
--
When you lose your mind, you free your life.


"Bob Phillips" wrote:

So does anything get selected?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in message
...
it loops through the other textboxes adds their values together, then
subracts that amount from a given total. THen plugs that amount into the

text
box that was just clicked. The looping does not in anyway setfocus or

select
the textboxes being read.
--
When you lose your mind, you free your life.


"Bob Phillips" wrote:

Works in my limited test. What does
'Change text then....
do?

--
HTH

Bob Phillips

"ben" (remove this if mailing direct) wrote in

message
...
I have a userform with four text boxes. When a user activates the

Enter
event
for any text box my code places a certain value in that box. That part
works
fine, however I want it to also select the text once it is entered
programmatically. THAT part does not work, no matter what I have

seemed to
try.

Private Sub py4_Enter()
'Change text then....
with py4
.selstart = 0
.sellength = len(.text)
.setfocus
end with
end sub


even moving the setfocus or REmoving it helped none. Am I missing
something
simple here?


--
When you lose your mind, you free your life.






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
select from combobox and show a price in textbox gem New Users to Excel 1 June 14th 06 11:37 AM
Select text in textbox Todd Huttenstine Excel Programming 2 December 16th 04 03:38 PM
select range textbox limitations harshad naik Excel Programming 0 September 16th 04 09:29 PM
check variable(text) with cell (text), textbox Mark[_17_] Excel Programming 1 August 27th 03 01:15 PM
Printing textbox text libby Excel Programming 1 August 13th 03 10:01 PM


All times are GMT +1. The time now is 04:50 AM.

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"