Hello,
I have a VBA code that seems to almost work but I am having an issue with 2 parts of it I would appreciate some help with.
I have 2 sheets, 'Totals' and 'Data'. 'Totals' is essentially the consolidated version of the 'Data' sheet. The 'Data' sheet has a list of employees in column A with other info filling out to the columns to the right. I am needing a VBA code that will copy that info over to 'Totals' based on cell G4 in 'Totals'. If the word in G4 matches text in column A in the 'Data' sheet then copy the row to the first blank cell starting at C14 on the 'Totals' sheet.
Here is what I am looking to do:
1. If text in G4 says Joe Schmo on the 'Totals' sheet then search the 'Data' sheet column A for a match. G4 will most likely be a drop down menu with the names.
2. If match is found then copy text (only) from row and paste to 'Totals' starting at C14 on first blank row (there may be 10-20 rows that are copied at a time)
Here is the code I have been working with. After some changes I now have errors:
As you can see, I am having an issue figuring out how to change "If c = "Joe Schmo" Then" to say "If C = Target.G4 Then" or something like that. Meaning that instead of specific text in the VBA code it actually reads the text in G4 on 'Totals'. I also am having an issue specifying that the cell it should paste on starts at C14 instead of A1 on "Totals". Lastly, I cant seem to remember how to say that I want text only as opposed it to keeping the formatting from the 'Data' sheet.Please Login or Register to view this content.
Just to make it as easy as possible I included a test workbook.
Thank you in advance for any assistance.
Bookmarks