Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Listbox Problem

I have a list box which I have set up which runs a message bank. I would
like it to have the ability to delete the sected message from the worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Listbox Problem

Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
I have a list box which I have set up which runs a message bank. I would
like it to have the ability to delete the sected message from the

worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg




  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Listbox Problem

Thanks will try it now

Greg
"Bob Phillips" wrote in message
...
Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
I have a list box which I have set up which runs a message bank. I would
like it to have the ability to delete the sected message from the

worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg






  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Listbox Problem

Bob

How can it be changed to delete the whole row.
sorry I just noticed I wrote it as a1:a1000 where it should be e1000

Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


Thanks in advance
Greg
"browie" wrote in message
...
Thanks will try it now

Greg
"Bob Phillips" wrote in message
...
Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
I have a list box which I have set up which runs a message bank. I
would
like it to have the ability to delete the sected message from the

worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg








  #5   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Listbox Problem

Private Sub CommandButton2_Click()

Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele
te
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
Bob

How can it be changed to delete the whole row.
sorry I just noticed I wrote it as a1:a1000 where it should be e1000

Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


Thanks in advance
Greg
"browie" wrote in message
...
Thanks will try it now

Greg
"Bob Phillips" wrote in message
...
Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
I have a list box which I have set up which runs a message bank. I
would
like it to have the ability to delete the sected message from the
worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg












  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Listbox Problem

Thanks Bob works Great

Greg
"Bob Phillips" wrote in message
...
Private Sub CommandButton2_Click()

Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele
te
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
Bob

How can it be changed to delete the whole row.
sorry I just noticed I wrote it as a1:a1000 where it should be e1000

Private Sub CommandButton2_Click()
Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


Thanks in advance
Greg
"browie" wrote in message
...
Thanks will try it now

Greg
"Bob Phillips" wrote in message
...
Private Sub CommandButton2_Click()

Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Delete
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
I have a list box which I have set up which runs a message bank. I
would
like it to have the ability to delete the sected message from the
worksheet.
How can I do this?

userform name is "splash"

listbox1 its rowsource is messagesa2:a1000
and the button i wish to use to delete is commandbutton2

any help with the code would be great

Thanks

Greg












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
Listbox Problem browie Excel Discussion (Misc queries) 5 August 22nd 05 02:03 PM
Listbox problem browie Excel Programming 1 August 22nd 05 11:44 AM
listbox problem #2 Keith Excel Programming 4 April 12th 05 06:32 PM
Listbox Problem [email protected] Excel Programming 4 August 19th 04 06:47 PM
ListBox problem Mike Fogleman Excel Programming 3 December 29th 03 12:23 PM


All times are GMT +1. The time now is 01:07 PM.

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"