• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Copy whole row from sheet 1 to sheet 2 if a cell in the row meets the criteria|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Copy whole row from sheet 1 to sheet 2 if a cell in the row meets the criteria|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Copy whole row from sheet 1 to shee…
sp_PrintTopic sp_TopicIcon
Copy whole row from sheet 1 to sheet 2 if a cell in the row meets the criteria
Avatar
David Wells
Member
Members
Level 0
Forum Posts: 9
Member Since:
October 30, 2018
sp_UserOfflineSmall Offline
1
June 13, 2019 - 2:42 am
sp_Permalink sp_Print

Hi help needed please

I want to be able to copy a whole row from sheet 1 to sheet 2 if a cell say D5 meets my criteria of 'Starter' then it copies that whole row in to sheet 2. But there might be 5 or more rows with Starter in D6, D7 etc and I want all of them as well to go on sheet 2. Can this be done if so how please?

I have put a mock up of sheet 1 below and want to copy all the ones that have Starter in column D to sheet 2 dynamically.

Any help appreciated.

Can I also ask is there a way of saving a worksheet as an image as only found on web either print screen or copy the worksheet and paste into Photoshop?

A B C D E F
ID Name No Type Loc Start date
101 Fred 2 Starter HR Jul-19
102 Pam 3 Starter HR Aug-19
103 Peter 4 Leaver BBC Jun-19
104 John 5 Transfer Comms Sep-19
105 Alice 6 Starter Comms Jul-19
Avatar
Frans Visser
Duivendrecht (near Amsterdam) - The Netherlands

VIP
Members
Level 2
Forum Posts: 346
Member Since:
April 21, 2015
sp_UserOfflineSmall Offline
2
June 13, 2019 - 5:54 am
sp_Permalink sp_Print

Hi David. I think this can be done by VBA, but that's not my cup of tea. Seeing your example I was thinking about a pivot table and then make a report which you can share to other sheets by for instance the type. It's a bit a work around, so maybe some VBA guy here can help you with that part. Otherwise I can try something with your data and explain that to you, if you like the idea?

About your second question: you can select a part of a sheet (or all the data on a sheet) copy that and paste it as an image. It depends on how much columns and rows you select if it stays visible in other programms. You can try it out by selecting some columns and rows, copy them, then choose paste as and look for the image symbol.

Good luck!

Frans

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4450
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
3
June 13, 2019 - 9:00 am
sp_Permalink sp_Print

Hi David,

Frans is right, a PivotTable is the best tool for this. It's robust, dynamic and requires zero coding!

See file attached. Here is a PivotTable tutorial explaining how you can also extract the different 'type' data to separate sheets, if that's a future need.

Mynda

Avatar
Robert Smith
UK
Member
Members
Level 0
Forum Posts: 9
Member Since:
June 12, 2019
sp_UserOfflineSmall Offline
4
June 13, 2019 - 9:35 pm
sp_Permalink sp_Print

Hi David

This routine attached will copy data from sheet1 to sheet2 

You can use partial search as well in the input box on the user form

Have you tried the camera operation to copy the screen ?

Rob

Avatar
David Wells
Member
Members
Level 0
Forum Posts: 9
Member Since:
October 30, 2018
sp_UserOfflineSmall Offline
5
June 19, 2019 - 6:57 am
sp_Permalink sp_Print

Hi Mynda

Thanks for that but I want it to copy the rows with a certain word, in this case Starter,included in one of the cells in the row.

The one from Rob does exactly what I need but would like to know the coding he has done to get it to work so if needed I could amend it if needed plus I would know exactly what it is doing.

Great website by the way loads of useful stuff.

Thanks

Dave

Avatar
David Wells
Member
Members
Level 0
Forum Posts: 9
Member Since:
October 30, 2018
sp_UserOfflineSmall Offline
6
June 19, 2019 - 7:01 am
sp_Permalink sp_Print

Robert Smith said
Hi David

This routine attached will copy data from sheet1 to sheet2 

You can use partial search as well in the input box on the user form

Have you tried the camera operation to copy the screen ?

Rob  

Hi Rob,

Can you let me know what code you have used for this so I know exactly what it is doing and I can tweak it if needed?

I know wnothing about the Camera operation I will search it in Excel.

Thanks for your help it does what I need but code would be good as I cannot see the macro.

Dave

Avatar
Robert Smith
UK
Member
Members
Level 0
Forum Posts: 9
Member Since:
June 12, 2019
sp_UserOfflineSmall Offline
7
June 19, 2019 - 5:17 pm
sp_Permalink sp_Print

Hi David

To get to the code right click on worksheet tab and select view code

Click on UF1 and click on command button to see code for it

The sub is Private so nobody can run the routine from the Macro menu

The function "FindAll" is located in Module 1, i would advise not to change anything in this code for the function otherwise it will screw up as this is the bit that finds all the data.

The code behind Command button you can amend as long as you have some VBA knowledge, if you need any help just let me know ok

PS on holiday from 20th to 30th so you might not get a reply till after that

Regards

Rob

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham, Riny van Eekelen
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
stuart burge
Bruce Tang Nian
Scot C
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Forum Stats:
Groups: 3
Forums: 24
Topics: 6223
Posts: 27295

 

Member Stats:
Guest Posters: 49
Members: 31920
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.