PDA

View Full Version : Solved: Copy row to another worksheet that meet criteria in column



coliervile
07-19-2006, 05:44 PM
I'm designing an Excel database that utilizes VB "userform" to input data into the main Database. What I want to do is look in Column "A" (called "NAME") for one name of an employee and copy that row of data to a "new" worksheet that houses that employees data and there will be duplicates of the same name. That is okay we want each row of data for each employees. I don't have the exact file, so I'll attach one that I already have. In the main database "OvertimeTotals" in the column "A" "NAME" there is the initials "AA" (stands for Adam Apple). There's another worksheet "Adam Apple" that I want to copy all of "AA's" rows of data from the "OvertimeTotals" worksheet to this worksheet "Adam Apple".

Can this be done from the "userform" for each employee or is it better to have a VB code for each employees worksheet?

Thanks for your help

Charlie

Alvinkiang
07-19-2006, 07:39 PM
Do you have any Coding Done so far??? my code did not help you solve thiss Problem??

coliervile
07-20-2006, 03:06 AM
Alvinkiang thanks for reply. I couldn't get my head around your formula. I'm a newbie to Macros and VBA's. I know what I need, but do know how to code it.

coliervile
07-20-2006, 05:27 AM
I made an error in the initial posting...where is says "OvertimeTotals" it should read "OvertimeDatabase"

I've also came up with the following code but I've run into an error? :banghead:
When I run the code It highlight A2 that contains "AA" in the "OvertimeDatabase" but does'nt copy over the data automatically. If you go to "Adam Apple" at the bottom of the worksheet it asks to press enter to "paste". WHAT AM I MISSING??? :help See attachment:

Also can this code be inserted to the "userfom" command button "Add Overtime" and update automatically when the main database "OvertimeDatabase" is updated???

Thanks for your help and sorry about the confusion.

Charlie
</IMG></IMG>