How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask The-PC-Guy Your Own Question

The-PC-Guy
The-PC-Guy, Computer Manager
Category: Microsoft Office
Satisfied Customers: 1406
Experience:  20 years experience providing remote computer support
62934938
Type Your Microsoft Office Question Here...
The-PC-Guy is online now
A new question is answered every 9 seconds

Need a macro to search a worksheet

Resolved Question:

Need a macro to search a worksheet with 2000 rows of employee data. Once it identifies employee by employee data I want it to copy multiple fields of data for that employee to a second worksheet located in a different workbook. Can someone tell me is this is possible. I tried and because it copies the exact cells, I can only run the macro once. If I run it a second time, it ignores new search criteria.
Submitted: 1 year ago.
Category: Microsoft Office
Expert:  The-PC-Guy replied 1 year ago.

The-PC-Guy :

Thanks for using JustAnswer. My name isXXXXX will do whatever I can to answer your question

The-PC-Guy :

Yes this is possible

The-PC-Guy :

can you send me a copy of the workbook in question so I can see how your data is arranged.

The-PC-Guy :

you can upload your workbook to www.wikisend.com

The-PC-Guy :

after uploading they give you a file ID

The-PC-Guy :

paste that here.

The-PC-Guy :

Actaully if you want to copy from one sheet to another workbook, I will need a copy of both workbooks to be able to do this for you.

The-PC-Guy, Computer Manager
Category: Microsoft Office
Satisfied Customers: 1406
Experience: 20 years experience providing remote computer support
The-PC-Guy and 3 other Microsoft Office Specialists are ready to help you
Expert:  The-PC-Guy replied 1 year ago.
The-PC-Guy :

Thanks for using JustAnswer. My name isXXXXX will do whatever I can to answer your question

The-PC-Guy :

Yes this is possible

The-PC-Guy :

can you send me a copy of the workbook in question so I can see how your data is arranged.

The-PC-Guy :

you can upload your workbook to www.wikisend.com

The-PC-Guy :

after uploading they give you a file ID

The-PC-Guy :

paste that here.

The-PC-Guy :

Actaully if you want to copy from one sheet to another workbook, I will need a copy of both workbooks to be able to do this for you

Customer: replied 1 year ago.

I am out at the moment will be home to upload in 45 minutes. Hope to have this by morning is that possible

Expert:  The-PC-Guy replied 1 year ago.
shouldn't be a problem once I understand what you need.

Hopefully you will be a round after uploading to answer any clarifications I may need to help you.

But from my basic understanding.

You can a column of ID numbers

you want the macro to prompt for an ID number.

Then take whatever data is in any row that matches that ID number,

copy that row to another workbook,

then delete the original row?
Customer: replied 1 year ago.


I uploaded two workbooks:


 


One is a template where the data needs to be copied and pasted in yellow boxes. http://wikisend.com/download/135570/Template.xlsx


 


Two is the data file. http://wikisend.com/download/439368/ALPHA Report.xlsx


 


I want to start with opening the template and selecting a macro button that opens the data file. Once at the data file, I need an input or find box to pop up so that I can key in perno to search for an employee. Once It finds the employee row, I want to cut and paste the required fields to the template in the yellow boxes. The next time I need a new workbook for another employee, I want to open the Template (where macro resides) click on the button, key in the perno (input) and have it look up the employee in the data workbook and copy and paste it over the template.

Expert:  The-PC-Guy replied 1 year ago.
so just to be clear on this

1. you are going to open the template file, and you want to click a button to run the macro which will be contained in the template file.

2. Then it will prompt you to select another workbook, this will contain the data. or will the data file always be the same, so it can be automatically opened?

3. Then you will be prompted for an ID number which is located in column B of the data file, we will then copy/concatenate the appropriate fields that are in yellow, over to the yellow boxes in the template file Sheet 1?

4. Then do we delete the row from the data file that we just copied, or do we leave it there?

Thanks
Customer: replied 1 year ago.

1. Yes open template to start process every time


2. Do not need a prompt, just automatically open file as it will always be the same name in the same location.


3. Yes, prompt to input or find ID number in column B. Copy/concatenate the appropriate fields from data workbook to template workbook. Example first name & last name will be concatenate to be copied to Employee Name Field. Salary will be copied over to salary field in yellow.


4. Good question. Once everything is copied to template workbook it will be saved out with a new name. The template is always empty so if user is going to use it again before closing, need a reset button to clean out fields. I know how to create reset macro and button.

Expert:  The-PC-Guy replied 1 year ago.
ok

gotya.
Expert:  The-PC-Guy replied 1 year ago.

i have this done for you.

http://wikisend.com/download/691838/Template.xlsm

 

also remember you will have to change the file name in the worksheet open to match where your file is located

let me know if you need any modifications

PLEASE REMEMBER TO RATE MY SERVICE

YOU DO SO WITH THE SMILEYS BENEATH THIS CHAT WINDOW

Customer: replied 1 year ago.

I will place macro in my workbooks and see if I can make work and
understand. Will review first thing in morning and see if I have any
questions. Thank you. Don't close my case just yet.

Expert:  The-PC-Guy replied 1 year ago.
ok, I will be here if you need anything
Customer: replied 1 year ago.


This macro has done exactly what I want. You are Wonderful! SmileBefore I finalize and provide you with your rating. Have questions.


 


I transferred macro over to my real workbook which has personal data in it that is confidential. I replaced file names and locations and actual cells but once I input the perno, it is not working. I think it is because the sheets have real names and may not be necessarily in the sheet 1 placement in the workbook. Do I have to do something to convert the Sheet 1 to real tab name Input which is the first tab and Sheet 1 in the other workbook to DS which is really sheet 3?

Expert:  The-PC-Guy replied 1 year ago.
that is correct, everywhere it refers to a sheet name, and I think there are about 4 or 5 spots. you would have to put the appropriate name. So for example

if you have something like

worksheets("Sheet 1").activate

you would change to

worksheets("Whatever your sheet name is").activate

remember that sheets are also specific to workbook.

I think i do a workbook.activate meathod a couple of times.

so where it says

workbooks("workbook name").activate

obviously that would refer to that workbook

and any

worksheets.activate functions following refer to that workbook

until you get to the next

workbooks.activate

then all sheets refer to that workbook.

hope this makes sense.

Let me know if you still get stuck.
Expert:  The-PC-Guy replied 1 year ago.
did that help?

If you are still having trouble.

Could I remote into your computer and help you. You would be able to see everything I am doing.

Let me know.
Customer: replied 1 year ago.

I tried one more thing. If this doesn't work, I would appreciate your accessing my computer.


Placed in Wikisend:


 


These are the actual files. I had to remove a lot of confidential info, but I altered the macro to fit cells and filenames.


 


http://wikisend.com/download/548932/Banded Salary Promo Workup Tool.xlsm


 


http://wikisend.com/download/666234/Alpha for SAL Workup.xls

Expert:  The-PC-Guy replied 1 year ago.
ok

first of all

this line

Workbooks("C:\Documents and Settings\chavispb\Desktop\SALWORKUP\Banded Salary Promo Workup Tool.xlsm").Activate

change it to just the file name, without the extension since this workbook is already open excel will find it as an object

so it should look like this

Workbooks("Banded Salary Promo Workup Tool").Activate

finally when you enter a number to search for, do not enter any leading 0000s

because the way excel evaluates it is as an integer and leading 00000s are automatically stripped off.

so if you are searching for 00054282 for example, you would enter that as 54282, and it will work.

if that gets confusing for the user you can change the cell format to general in column b of the


http://wikisend.com/download/666234/Alpha for SAL Workup.xls

 

file

 

and it will strip out all of the zeros that are displayed.

 

hope this helps.

 

if it still does not let me know and I will do the remote



Expert:  The-PC-Guy replied 1 year ago.
whats the latest?

Did you finally get it to work?

If you are still struggling then let me do the remote and help you.

Anything I see will be kept confidential.

Let me know
Customer: replied 1 year ago.


It is working wonderfully. I just couldn't figure out how to respond back to you without this reply box. I want to provide you with an SmileEXCELLENT SERVICESmile Rating but I can't select the rating provided. Can you provide guidance for how I can provide feedback? I really appreciate all the work you did. Your understanding and patience, as well as your knowledge is incredible. I am so glad that I found you online. I would never have been able to complete this project without you. You are a star and have made me one as well.

Expert:  The-PC-Guy replied 1 year ago.
Thanks

I will ask customer service to contact you to help with the rating process.

---------------------------------------------------------------------------------------------------------------

if you have any questions in the future you can visit my profile

http://www.justanswer.com/computer/expert-1expert-2rulethemall/

and ask a question right in my box,

also you can put "PC Guy only" in your question title if you want to get to me.

---------------------------------------------------------------------------------------------------------------

Let me know if that was unclear

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional
 
 
 

Related Microsoft Office Questions

Chat Now With A Microsoft Office Technician
The-PC-Guy
The-PC-Guy
329 Satisfied Customers
20 years experience providing remote computer support