简体   繁体   中英

Excel Macro to Copy and Paste Format Line by Line instead of range of cells

I am using conditional formatting in Excel 2007 to compare values row by row in cells H, K and U.

Since I am trying to use the conditional fomartting row by row instead of a range of cells. My hand cramped up by row 50, and I have another few hundreds to go.

Is there a macro that would check the rows and paste the format without having to do one at a time?

A million thanks.

You don't need to apply the conditional formatting row-by-row. If you use the proper combination of relative and absolute references in your conditional formatting formula, you can do it all in one shot. For example, select A1:C10 and enter this formula for conditional formatting

=$A1=1

Because I made the column absolute with the dollar sign, every cell in A1:C10 will refer to column A. But since the row is relative, every cell will refer to column A on its same row. So B8's conditional format formula will be =$A8=1

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