#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Easy Question

I have the following code:

Private Sub CommandButton7_Click()
UserForm1.ListBox2.Add("A", "B", "C")
End Sub


I am having trouble with line 2. Im not sure how to add the "A", "B" and C
in userform 1 listbox by clicking command button 7.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Easy Question

Is this commandbutton on the same userform as the listbox?

Private Sub CommandButton7_Click()
with me.ListBox2
.Additem "A"
.additem "B"
.additem "C"
end with
End Sub

M&M wrote:

I have the following code:

Private Sub CommandButton7_Click()
UserForm1.ListBox2.Add("A", "B", "C")
End Sub

I am having trouble with line 2. Im not sure how to add the "A", "B" and C
in userform 1 listbox by clicking command button 7.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Easy Question

The command button is not in the same userform as the listbox. The command
button is in Userform2 and the listbox2 is in Userform 1. Is this gonna be a
problem?

"Dave Peterson" wrote:

Is this commandbutton on the same userform as the listbox?

Private Sub CommandButton7_Click()
with me.ListBox2
.Additem "A"
.additem "B"
.additem "C"
end with
End Sub

M&M wrote:

I have the following code:

Private Sub CommandButton7_Click()
UserForm1.ListBox2.Add("A", "B", "C")
End Sub

I am having trouble with line 2. Im not sure how to add the "A", "B" and C
in userform 1 listbox by clicking command button 7.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Easy Question

Change the
with me.listbox2
back to
with userform1.listbox2

M&M wrote:

The command button is not in the same userform as the listbox. The command
button is in Userform2 and the listbox2 is in Userform 1. Is this gonna be a
problem?

"Dave Peterson" wrote:

Is this commandbutton on the same userform as the listbox?

Private Sub CommandButton7_Click()
with me.ListBox2
.Additem "A"
.additem "B"
.additem "C"
end with
End Sub

M&M wrote:

I have the following code:

Private Sub CommandButton7_Click()
UserForm1.ListBox2.Add("A", "B", "C")
End Sub

I am having trouble with line 2. Im not sure how to add the "A", "B" and C
in userform 1 listbox by clicking command button 7.


--

Dave Peterson


--

Dave Peterson
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
If - easy question mldancing Excel Discussion (Misc queries) 5 March 28th 07 01:26 PM
*EASY* question! Laura \( '_' \) New Users to Excel 3 November 25th 05 12:02 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
easy question Dahlman Excel Worksheet Functions 3 April 1st 05 11:11 PM
easy question .... i think Dean Excel Discussion (Misc queries) 1 January 6th 05 06:31 PM


All times are GMT +1. The time now is 06:11 AM.

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"