|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Using a macro with if statement to populate a list from one worksheet to another
I have an Excel workbook with multiple tabs. On one tab ("Roster"), I have a list of nursing homes where I work and a list of residents that I work with at those homes.
I want a macro that copies names from the Roster tab and pastes them into the corresponding nursing home tab ("AL," "Bri," etc). I assume this will require some kind of If statement within the macro. I.e. If a cell in column A on Roster tab = "AL", then select the cell in column B, and paste it into the "AL" tab. How can I pull this off? TIA! |
#2
|
|||
|
|||
Why you want to do this? Why not simply to have a report sheet, where you select (using data validation list) a nursing home, and get there a list of residents in this nursing home (E.g. having in Roster table hidden columns where the numbers of every roster table row in one, and the number of record in roster table with name of nursing home equaling with the name selected currently in report sheet? This allows easily to generate in report sheet a list of all residents of selected nursing home there {a hint - SUMIFS() and INDEX() functions are, what you need to use}).
|
#3
|
||||
|
||||
If you would post the sample files, not images, you would get better solutions like Power Query, Pivot or formulae, whichever works.
|
Tags |
copy and paste, if then statement, macro |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to populate a dropdown list with a spcific column in a specific worksheet | ericliu24 | Word VBA | 2 | 03-17-2022 05:24 AM |
How to populate a userform combobox from an excel worksheet | jrooney7 | Word VBA | 14 | 09-16-2018 08:52 PM |
How do I populate Worksheets using information entirely from another Worksheet in the same Workbook? | BrieDanielle | Excel | 1 | 06-18-2016 10:50 AM |
Populate Pulldown list with Macro | Samedy | Word VBA | 1 | 02-25-2014 06:59 PM |
DRop down list within text of If statement | sbarron76 | Mail Merge | 2 | 05-03-2013 05:00 AM |