PC Review


Reply
Thread Tools Rate Thread

Automatically Populate Worksheet Depending on Team Name

 
 
Qaspec
Guest
Posts: n/a
 
      11th Jan 2008
On my first worksheet "Ws1" I have a table of data. Column A has Team Name
and Column B has Item Num. On worksheet 2 I have a blank worksheet "Ws2" that
I would like to automatically populate with data from "Ws1" when a team is
selected from a list box "LB1" and a button is clicked "VR1". I only want to
select from 'Ws1" and display in "Ws2" those rows where the team name is
equal to the team name selected in the listbox. "Ws2" has the same column
headers. Thanks.
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      11th Jan 2008
Sub getteams()

teamname = Sheets("WS2").LB1.Value
WS2RowCount = 2
With Sheets("Ws1")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
For WS1RowCount = 2 To LastRow
If .Range("A" & WS1RowCount) = teamname Then
.Rows(WS1RowCount).Copy _
Destination:=Sheets("WS2").Rows(WS2RowCount)
WS2RowCount = WS2RowCount + 1
End If
Next WS1RowCount

End With

End Sub

"Qaspec" wrote:

> On my first worksheet "Ws1" I have a table of data. Column A has Team Name
> and Column B has Item Num. On worksheet 2 I have a blank worksheet "Ws2" that
> I would like to automatically populate with data from "Ws1" when a team is
> selected from a list box "LB1" and a button is clicked "VR1". I only want to
> select from 'Ws1" and display in "Ws2" those rows where the team name is
> equal to the team name selected in the listbox. "Ws2" has the same column
> headers. Thanks.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically populate worksheet Maggie Microsoft Excel Worksheet Functions 2 24th Feb 2009 09:11 PM
Automatically populate cells based on info in another worksheet Francis Microsoft Excel Worksheet Functions 2 10th Jun 2008 08:17 PM
Automatically Name Tabs from List on Worksheet Named Team =?Utf-8?B?Q2hlcmk=?= Microsoft Excel Misc 10 12th Apr 2008 03:34 AM
populate form text fields depending on combo box selection =?Utf-8?B?U3RldmUgSGFsbGV5?= Microsoft Access Form Coding 1 15th Dec 2006 06:51 PM
Populate, Depending on Criteria =?Utf-8?B?QmxvYmJpZXM=?= Microsoft Excel Misc 1 27th Sep 2006 12:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 PM.