coloring even row without looping

ericlch16

Active Member
Joined
Nov 2, 2007
Messages
311
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hi

I have a lot of worksheet of many workbooks to colour the alternate row. Currently I am doing a loop for each row of each worksheet of each workbook to change the interior colour of odd numbered rows that contains values. It is working well.

However, when i inserted colour change code, this is slowing down the macro a lot. Is there a better way to do the color without looping and affecting performance of the macro?

Thanks,
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Use conditional formatting.
MrExcelPlayground.xlsm
ABC
1Emp NameEmp IDGroup
2Emp1a1TET
3Emp2a2TET
4Emp3a3BSD
5Emp4a4GERT
6Emp5a5KPIOT
7Emp6a6TET
8Emp7a7BSD
9Emp8a8GERT
10Emp9a9TET
11Emp10a10BSD
12Emp11a11TET
13Emp12a12BSD
14Emp13a13GERT
15Emp14a14KPIOT
16Emp15a15TET
17Emp16a16BSD
18Emp17a17GERT
19Emp18a18KPIOT
20Emp19a19TET
21Emp20a20BSD
22Emp21a21TET
23Emp22a22BSD
24Emp23a23GERT
25Emp24a24KPIOT
Sheet38
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:C25Expression=ISODD(ROW())textNO
 
Upvote 0
I think you have 3 options
1) use Conditional formatting
2) convert all the data to Tables & use a suitable table style
3) loop through the data with a macro.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

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