You are here:

Excel/VBA or Macro to get info from other sheet


sheet need filled
sheet need filled  

sheet data from (has formulas in it)
sheet data from (has f  
Hello and hope all is well with you and yours. I have the following request. I have a sheet in my workbook tha I need to fill from another sheet in my workbook. The following is the critiera
If in Tourofdutyrecord (workbook)  whosmynursedays  (active sheet) sheet2  (reference sheet) $C4$E85. (criteria) any one of the following “7, 7C, 7CMTG, 7MTG, 6, 6C, 6CMTG, 6MTG, NOON” in c4:e85. If criteria met then get name after (comma and space) from sheet2  column B (in same row meeting criteria i.e. if 7 in d4 then get name after  “,” from b4) and place in (active sheet) whosmynursedays  A7.  Then goto B7 using same criteria and fill whosmynurse row b7 and so on till H7 filled or no more names meeting criteria from Tourofdutyrecord sheet2 $C4$E84.
Will need the same for (TAB/SHEET) whossmynurseevening but with criteria “3, 3C, 3CMTG, 3MTG, NOON” from same array $C4 $E84.
If possible can you breakdown each step in code so I can learn and hopefully duplicate for whosmynurseevening with the necessary modifications. I would really like to learn this part of excel and do not want to keep burdening everyone for their work.
Thank you for looking and especially for doing. I am attaching a pic of what I need. If you would like you can get to me at jmendenhall22{at}gmaildotcom.

Hello John,

This looks like a job for Vlookup. Vlookup searches for a matching value in a range and picks up the nth column corresponding to the matching value. If you try using Vlookup with If condition, you might get what you need even without a macro.

Hope this helps,
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts




I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.


I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2017 All rights reserved.