Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2023, 08:58 AM
clcummings's Avatar
clcummings clcummings is offline Using a macro with if statement to populate a list from one worksheet to another Mac OS X Using a macro with if statement to populate a list from one worksheet to another Office 2016 for Mac
Novice
Using a macro with if statement to populate a list from one worksheet to another
 
Join Date: Apr 2023
Posts: 1
clcummings is on a distinguished road
Question 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!
Attached Images
File Type: jpg Screenshot 2023-04-03 at 10.41.32 AM.jpg (148.5 KB, 13 views)
File Type: jpg Screenshot 2023-04-03 at 10.41.53 AM.jpg (117.2 KB, 13 views)
Reply With Quote
  #2  
Old 04-03-2023, 01:05 PM
ArviLaanemets ArviLaanemets is offline Using a macro with if statement to populate a list from one worksheet to another Windows 8 Using a macro with if statement to populate a list from one worksheet to another Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

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}).
Reply With Quote
  #3  
Old 04-10-2023, 08:53 PM
Marcia's Avatar
Marcia Marcia is offline Using a macro with if statement to populate a list from one worksheet to another Windows 11 Using a macro with if statement to populate a list from one worksheet to another Office 2021
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

If you would post the sample files, not images, you would get better solutions like Power Query, Pivot or formulae, whichever works.
Reply With Quote
Reply

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
Using a macro with if statement to populate a list from one worksheet to another 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
Using a macro with if statement to populate a list from one worksheet to another Populate Pulldown list with Macro Samedy Word VBA 1 02-25-2014 06:59 PM
Using a macro with if statement to populate a list from one worksheet to another DRop down list within text of If statement sbarron76 Mail Merge 2 05-03-2013 05:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft