Excel/Insertion point

Advertisement


Question
assume that the insertion point is positioned at the beginning of the txtName text box. which one of following instructions will select the contents of the txtName text box?
txtName.SelAll=txtName.Text
txtName.SelLen=Length[txtName.Text]
txtName.SelLength=txtName.Text
txtName.SelLength=Len[txtName.Text]
thanks

Answer
technically none of them as it needs round not square brackets, also not a method I use myself, but a simple process of trial and error would reveal the answer - I mention this to help wih future assignments as this SEEMS to be an assigment - if you create a userform and put a textbox and a command button, behind the command button enter all the options - only one works as would be expected which is

txtname.SelLength = Len(txtname.Text)

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2012 About.com, a part of The New York Times Company. All rights reserved.