Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please :) I'm VBA Stumped
an Shout out to all Excel Wizards!!
My Problem, take populated cells from column A of sheet 1 and search and copy rows from sheet 2 that match the certain of column E, and paste full rows to sheet3 until all cells in sheet 1 have been used up. Im trying to have it run from VBA with a button on sheet 1 or a macro. this is what I have to work with. Sheet 1 (Paste in UserID numbers, ending row varys) Column Names Column Letter UserID----------------------A Sheet 2 (All Records, updates monthly, ending row varys) Column Names Column Letter FirstName -------------------A LastName--------------------B UserName-------------------C Password--------------------D UserID-----------------------E Sheet 3(Generated back on search results "Rows" found from Sheet 2) Column Names Column Letter FirstName -------------------A LastName--------------------B UserName-------------------C Password--------------------D UserID-----------------------E Thank You in advance for your reading time and of any help you could provide!! ~ Marc |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please :) I'm VBA Stumped
If your data has headers in row1 on both Sheet1 and Sheet2 , you can do it
with Advanced Filter. If not, put headers there. The header in Sheet1, A1 should be the same as Sheet2, E1. Sub CopyData() Dim rng As Range With Worksheets("Sheet1") Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown)) End With Sheets("sheet2").Range("A1") _ .CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=rng, CopyToRange:=Worksheets( _ "Sheet3").Range("A1"), Unique:=False End Sub Assume sheet3 is blank. -- Regards, Tom Ogilvy "Marc" wrote in message oups.com... an Shout out to all Excel Wizards!! My Problem, take populated cells from column A of sheet 1 and search and copy rows from sheet 2 that match the certain of column E, and paste full rows to sheet3 until all cells in sheet 1 have been used up. Im trying to have it run from VBA with a button on sheet 1 or a macro. this is what I have to work with. Sheet 1 (Paste in UserID numbers, ending row varys) Column Names Column Letter UserID----------------------A Sheet 2 (All Records, updates monthly, ending row varys) Column Names Column Letter FirstName -------------------A LastName--------------------B UserName-------------------C Password--------------------D UserID-----------------------E Sheet 3(Generated back on search results "Rows" found from Sheet 2) Column Names Column Letter FirstName -------------------A LastName--------------------B UserName-------------------C Password--------------------D UserID-----------------------E Thank You in advance for your reading time and of any help you could provide!! ~ Marc |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please :) I'm VBA Stumped
Hello Tom,
The Code works like a charm, Thankyou ever so much!!! ~Marc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
This has me stumped | Excel Discussion (Misc queries) | |||
Stumped | Excel Discussion (Misc queries) | |||
Still stumped | Excel Worksheet Functions | |||
stumped | Excel Worksheet Functions | |||
stumped ?? | Excel Worksheet Functions |