ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete an Item in a list box (https://www.excelbanter.com/excel-programming/308584-delete-item-list-box.html)

Fred Jacobowitz

Delete an Item in a list box
 
Is it possible to select a line in a textbox and the delete it using vba. I
would like to simulate the user clicking a row in a textbox and then
entering the delete key? The textbox is not on a 'form' but rather on the
spreadsheet. Does it matter?

The textbox was loaded using something like.

If TextBox1.CanPaste = True Then
TextBox1.WordWrap = False
TextBox1.MultiLine = True
TextBox1.ScrollBars = fmScrollBarsBoth
TextBox1.Text = ""
TextBox1.Paste
end if
Thank you,
Fred Jacobowitz



Fred Jacobowitz

Delete an Item in a list box
 
Sorry - Subject should read - Delete an Item in a text box
"Fred Jacobowitz" wrote in message
...
Is it possible to select a line in a textbox and the delete it using vba.
I would like to simulate the user clicking a row in a textbox and then
entering the delete key? The textbox is not on a 'form' but rather on the
spreadsheet. Does it matter?

The textbox was loaded using something like.

If TextBox1.CanPaste = True Then
TextBox1.WordWrap = False
TextBox1.MultiLine = True
TextBox1.ScrollBars = fmScrollBarsBoth
TextBox1.Text = ""
TextBox1.Paste
end if
Thank you,
Fred Jacobowitz




ross

Delete an Item in a list box
 
Try looking at selection, or active selection,
textbox1.seltext.delete ? might work, be somthing like this there is
also CurLine prop. might be able to do something with that.

"Fred Jacobowitz" wrote in message ...
Sorry - Subject should read - Delete an Item in a text box
"Fred Jacobowitz" wrote in message
...
Is it possible to select a line in a textbox and the delete it using vba.
I would like to simulate the user clicking a row in a textbox and then
entering the delete key? The textbox is not on a 'form' but rather on the
spreadsheet. Does it matter?

The textbox was loaded using something like.

If TextBox1.CanPaste = True Then
TextBox1.WordWrap = False
TextBox1.MultiLine = True
TextBox1.ScrollBars = fmScrollBarsBoth
TextBox1.Text = ""
TextBox1.Paste
end if
Thank you,
Fred Jacobowitz



All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com