LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 2 lists - extract from one all matches, edit in a new list then re

I have to be honest and tell you that I don't work very much with comboboxes,
but this seemed to work OK when I tested it. Try it on a copy of your sheet
in a new wb first.

Sub cpyPstCmbo()

Dim ws1 As Worksheet, ws2 As Worksheet, cb As Variant
Set ws1 = Worksheets(1)
Set ws2 = Worksheets(2)
UserForm1.Show
Set cb = UserForm1.ComboBox1

lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lr
If Cells(i, 1) = cb.Value Then
Cells(i, 1).EntireRow.Copy
ws2.Activate
If Cells(1, 1) < "" Then
ws2.Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1).Activate
Else
ws2.Cells(1, 1).Activate
End If
ActiveSheet.Paste
ws1.Activate
End If
Next
Application.CutCopyMode = False
End Sub


"colorado808" wrote:

How do I cut a set of data lines from a worksheet of data and put them into
another worksheet, based upon a match of one field to a combo box.

i.e. select a name in a combo box

go to the detailed data worksheet

find all lines that match that name in a particular field

cut those lines from the detailed worksheet and put them in another worksheet.

The data worksheet will continually be changing in size...

Any suggestions?

 
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
Compare lists and highlight matches srain001 Excel Discussion (Misc queries) 3 March 2nd 07 06:23 PM
Compare lists and highlight matches srain001 Excel Discussion (Misc queries) 2 March 1st 07 02:01 PM
Loop through the columns and extract the matches ebraun01 Excel Programming 14 February 17th 06 10:26 PM
An Algorithm that matches two lists DDONNI[_2_] Excel Programming 0 October 25th 04 02:25 PM
An Algorithm that matches two lists DDONNI Excel Programming 1 October 19th 04 12:16 PM


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