Excel/visual basic help
Expert: Jan Karel Pieterse - 11/7/2009
Questionassume 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
AnswerHi Shawn,
You do need to specify the SelStart too, so this should do the trick:
txtName.SelStart = 0
txtName.SelLength = Len(txtName.Text)
If you use a button to invoke this, you can set the focus back to the textbox like this:
txtName.SetFocus
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