Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Populating Userform and then using selected data.

I have a worksheet called Listing. There will be more/less WS as people
move around, but lets call these sheets Tom, Bob, and Jim.

WS Listing has 12 columns with headers. Not all the cells are filled in all
the columns. The headers start in 3A and the data starts in 4A. All of it
is in a list.

The WS Tom, Bob, and Jim are all the same format so I will describe only WS
Tom
WS Tom uses five columns starting in A8.

WS Tom has a command button which starts a macro to start a userform. The
user form is a multiselect Listbox. I need the userform to go to WS Listing
and pull columns A-E and H-I starting in row 4 and going until there are no
more entrees in row E or I (these columns will both always have an entree if
the row is used). Also it needs to clear itself everytime before it reloads
the list so that it will get the most current inventory.

The same userform has a command button. After the user selects all the
desired items they will click this to run another macro I would assume. I
would like it to copy the selcted items in columns A,B,E,H,I from WS Listing
and the WS title of the WS it is selected from (in this case Tom) to WS
Pending starting in A7 (the headers start in A6).

I have been trying with the help functions, but I have only been able to get
the command button to pull up the userform and put some of the information in
it. I am not good at this by any means so please speak slowly. Thank you in
advance for any help.

Regards,
AUCP03
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Populating Userform and then using selected data.

On Aug 13, 1:16*pm, AUCP03 wrote:
I have a worksheet called *Listing. *There will be more/less WS as people
move around, but lets call these sheets Tom, Bob, and Jim.

WS Listing has 12 columns with headers. *Not all the cells are filled in all
the columns. *The headers start in 3A and the data starts in 4A. *All of it
is in a list.

The WS Tom, Bob, and Jim are all the same format so I will describe only WS
Tom
WS Tom uses five columns starting in A8.

WS Tom has a command button which starts a macro to start a userform. *The
user form is a multiselect Listbox. *I need the userform to go to WS Listing
and pull columns A-E and H-I starting in row 4 and going until there are no
more entrees in row E or I (these columns will both always have an entree if
the row is used). *Also it needs to clear itself everytime before it reloads
the list so that it will get the most current inventory.

The same userform has a command button. *After the user selects all the
desired items they will click this to run another macro I would assume. *I
would like it to copy the selcted items in columns A,B,E,H,I from WS Listing
and the WS title of the WS it is selected from (in this case Tom) to WS
Pending starting in A7 (the headers start in A6).

I have been trying with the help functions, but I have only been able to get
the command button to pull up the userform and put some of the information in
it. *I am not good at this by any means so please speak slowly. *Thank you in
advance for any help.

Regards,
AUCP03


AUCP03,

Do you have any code to post? In general a ListBox can be filled with
AddItem and/or RowSource (and I'm sure there are other ways too). You
can remove items via Clear/RemoveItem or by unloading the form (i.e.
Unload Me -- Me equals the referenced class, in this case the parent
user form. So, if your user form is named UserForm1 and you have code
behind this user form, then Me is equivalent to UserForm1). After
your list box is filled, you can then loop through the items with a
For loop (the ListCount property will tell you how many items are in
your list box), or you can reference the selected item through the
Selected property. Look at some of these methods and properties to
see if this gets you pointed in the right direction.

As an aside, if you are curious in how to see what methods and
properties are available you can do at least two things after you add
a user form in the VBE (1) in a code module, type the user form name,
a ".", the list box name, and then a ".". Once you enter the second
"." the Intellisense will popup, showing the methods and properties
(2) open the object browser (View | Object Browser; or simply, F2),
search by the userform name (which will appear in the "Classes" list),
and view the "Members". (Methods have the 3D, slanted box that seems
to be moving to the right and properties have the icon that looks like
a hand holding a card )

Best,

Matthew Herbert
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
Populating dropdown list 2 with data depending upon what was selected in list 1 karambos Excel Programming 2 November 9th 04 05:32 PM
Populating data on userform gki[_6_] Excel Programming 6 July 29th 04 07:35 AM
Populating Sheet Data From A UserForm Combo Box Enabled For Multi-Choices R3df1sh[_3_] Excel Programming 1 December 4th 03 08:58 PM
Populating a VBA UserForm Danny Sowden Excel Programming 0 August 19th 03 03:11 PM
Populating Textbox in UserForm Derek[_2_] Excel Programming 3 July 10th 03 10:41 PM


All times are GMT +1. The time now is 07:04 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"