简体   繁体   中英

Copy cells content to other cells if a certain cell is true in Excel

How can I copy the contents in two cells onto other two cells if another cell is true?

Of instance, in the following example I'm copying the content from D3 onto F3 if B3 is TRUE. What I would like to be able to do is copy the contents of D3 and E3 onto F3 and G3 if B3 is TRUE.

在此处输入图像描述

I tried the following but it doesn't work.

IF(B3=TRUE, Range("D3:E3").Copy Range("F3:G3"), "")

Again, how can I copy the contents of two cell onto other two cell if a certain cell is true?

If one has Office 365 put this in F3:

=IF(B3,D3:E3,"")

and the results will spill over to the next cell.

在此处输入图像描述

If one does not have office 365 then each cell will need a formula:

Put this in F3:

=IF($B3,D3,"")

And drag it over one column into G3.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM