IF statement: Logic check on cell in 1 worksheet; if true copy row into another worksheet row

PTHops

New Member
Joined
May 18, 2016
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I have a workbook with a Worksheet title "Trip Ticket Log". I have 5 worksheets title "PSPC", "CCG", "COMMS", "IT", "IM"

On the "Trip Ticket Log" sheet Column G has a validation pick list that correspond to the name of the other worksheet (PSPC, CCG, etc)

What I want to do:

IF 'Trip Ticket Log" G: = PSPC (if on the PSPC sheet), place the values from the cells on that row on Trip Ticket Log to a blank row on PSPC (or corresponding sheet if CCG or other is selected from the pick list)

Doable? Thanks in advance!

PTHops
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Say on Trip Ticket Log row 1 is PSPC and row 2 is CCG ... would you want the data from row 2 of Trip Ticket Log to appear on row 1 or row 2 of CCG?

If you're happy for it to be on row 2 (I.e. each sheet will have blank rows where data relates to another sheet), then you just need basic IF formulae, e.g. in PSPC sheet cell A1:
=IF('Trip Ticket Log'!G1="PSPC",'Trip Ticket Log'!A1,"")

If you don't want blank rows, and you want the sheets to automatically update for any changes, you'll need a macro that runs whenever the Trip Ticket Log sheet changes ... this could affect performance speed, particularly if there are a lot if records/changes.
 
Upvote 0
Sorry to sound thick (I am could with a basic IF statement but not this complicated one - or sounds complicated to me).

When I customize the formula for the cells where the drop down is I use =IF('Trip Ticket Log'!G2="PSPC",'Trip Ticket Log'!A2,"")

- I placed to IF Statement in the first available cell on PSPC sheet (A2 since there is a header)

- 'Trip Ticket Log'!G2="PSPC" is the pick list cell

I have been able to get the information from A of "Trip Ticket Log" replicated to PSPC, but not the full row of information.

I also would want to remove the blank lines in the PSPC sheet since the formula is looking for row to matching row and not adding info from Trip Ticket Log into the next empty row of PSPC, but that can be done manually since I don't expect there to me numerous entries for these outlier users of our fleet.

Doable at all, or am I dreaming pie in the sky efficiency here?

Thanks for your help!
 
Upvote 0
With the If statement option, you will need to copy the formula into every column that contains data that you want brought across. If you amend the formula slightly to:
=IF('Trip Ticket Log'!$G2="PSPC",'Trip Ticket Log'!A2,"")
you can copy it across columns, and not lose the reference to column G.

Removal of the blank rows could only be automated with a macro.
 
Last edited:
Upvote 0
Awesome! Works perfect!!! And all I need to do is HIDE the blank rows to give a clean look :-) Thank you sooo much for sharing your expertise.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top