Does Excel have IF THEN and automatically copy paste functions?

cssung711

New Member
Joined
Apr 10, 2015
Messages
2
Hi everyone:)

I have a set of data that looks like:
FromToCost
0110
0311
0415
126
151
213
241
3......
.........
4......
4.....

<tbody>
</tbody>
And it goes on.


Question: is there a way that excel can do --->
IF B2 =1
THEN copy A5, B5, C5 and paste on D2, E2, F2 (or paste on different tab/separate table)
AND copy A6, B6, C6 and past on D3, E3, F3.


IF B2 = 3
THEN stop


IF B3 = 3
THEN copy A9 ..... (similar to when equal 1)


Thanks in advance if anyone have a way to solve this!!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Not sure if you are new to Excel, but it has a macro / programming language VBA built-in. You can write your own code, which is similar to your pseudo-code above:

Rich (BB code):
Public Sub ifthenlogic
  If [B2]= 1 Then
    [A5:C5].Copy Destination:=[D2]
  End If

  ' etc...
End Sub

The language is actually Visual Basic, so if you know some programming you can do it pretty easily. Anyway - look into that possibility.
 
Upvote 0

Forum statistics

Threads
1,215,740
Messages
6,126,586
Members
449,319
Latest member
iaincmac

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