Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
This has me stumped wild turkey no9 Excel Discussion (Misc queries) 5 March 14th 10 03:16 AM
Stumped lightbulb Excel Discussion (Misc queries) 3 December 21st 09 03:56 PM
Still stumped LarryK Excel Worksheet Functions 7 March 30th 09 11:15 AM
stumped LarryK Excel Worksheet Functions 4 March 28th 09 05:54 PM
stumped ?? my Excel Worksheet Functions 2 April 13th 06 12:32 PM


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