LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default command button that copies and pastes from one list box to another

I inserted the below code to accomplish the below. Why do I get an error for
the i ?

Private Sub CommandButton1_Click()
If ListBox2.ListIndex = -1 Then Exit Sub
If Not cbDuplicates Then
'See if item already existss
For i = 0 To ListBox2.ListCount - 1
If ListBox2.Value = ListBox3.List(i) Then
Beep
Exit Sub
End If
Next i
End If
ListBox3.AddItem ListBox2.Value

End Sub
 
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
clicking on a button copies the choice *(VBA) Thrava Excel Discussion (Misc queries) 1 October 2nd 06 10:42 PM
Some formulas don't track copies, pastes, fill right, fill down whiten Excel Discussion (Misc queries) 2 October 1st 06 04:41 PM
Where is a list of Command Button uses? KT in Houston Excel Discussion (Misc queries) 0 September 12th 06 05:29 PM
A Macro that Copies from Excel & Pastes into a webpage Eric Excel Discussion (Misc queries) 1 July 14th 06 12:38 AM
Copies 02/22/2005, Pastes 02/21/2001 Carole O Excel Worksheet Functions 3 March 2nd 05 08:28 PM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"