Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Automatically Populate Worksheet Depending on Team Name

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Automatically Populate Worksheet Depending on Team Name

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
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
automatically populate worksheet Maggie Excel Worksheet Functions 2 February 24th 09 09:11 PM
Automatically populate cells based on info in another worksheet Francis Excel Worksheet Functions 2 June 10th 08 08:17 PM
Automatically Name Tabs from List on Worksheet Named Team Cheri Excel Discussion (Misc queries) 10 April 12th 08 03:34 AM
Team Role Rotation (number of team members is variable) Scott Wagner Excel Worksheet Functions 3 November 17th 06 11:25 PM
Populate, Depending on Criteria Blobbies Excel Discussion (Misc queries) 1 September 27th 06 12:37 PM


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