Excel - Macro to Shade Alternate Rows in a Selection
See how to write a macro that shades alternate rows in a selection in an Excel worksheet. The Macro can be customized with different colours of your choice. The macro only formats the selected area so you're not dealing with an entire workbook that has striped rows.
This is the macro code:
Sub FormatRows()
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=0"
.FormatConditions(1).Interior.Color = RGB(142, 169, 219)
.FormatConditions(1).StopIfTrue = False
.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=1"
.FormatConditions(2).Interior.Color = RGB(153, 204, 255)
.FormatConditions(2).StopIfTrue = False
End With
End Sub
VIEW MORE VIDEOS JUST LIKE THIS ON MY YOUTUBE CHANNEL
Microsoft Office ► / @mastermicrosoftoffice
TIP ME TO SAY THANK YOU? ► paypal.me/projectwoman
VISIT PROJECTWOMAN.COM FOR MORE ON MICROSOFT OFFICE APPLICATIONS:
Website ► http://www.projectwoman.com
Blog ► http://www.projectwoman.com/blogger
LET'S CONNECT!
Facebook ► / projectwoman
Twitter ► / helenbradley
LinkedIn ► / helenbradley
IF YOU LIKED THIS VIDEO YOU MAY LIKE THESE SIMILAR VIDEOS:
Microsoft Excel Mac - Remove Custom Templates ► • Excel Mac - Remove Templates
Microsoft Word - Images in Tables - How to place & position pictures in Word Tables ► • Word - Images in Tables - How to place & p...
Microsoft Word - Change Default Image Wrap ► • Word - Change Image Default - Make Text Wr...
Microsoft Excel - Custom Lists and Sort lists ► • Excel - Custom Lists and Sort lists - Make...
Microsoft Excel - Count days between two dates ► • Excel - Count days between two dates
Microsoft Word - Table Cell Widths - Adjust one or more with ease ► • Microsoft Word - Table Cell Widths - Adjus...
A Microsoft Word Macro to Resize All Images in a document • A Word Macro to Resize All Images in a doc...
Microsoft Excel - Format a List Instantly - Quick & Easy Table Formatting Trick for Lists ► • Insanely Simple Excel Formatting Trick
Office Tab for Word Excel and PowerPoint - A quick look at this handy application ► • Office Tab for Word Excel and PowerPoint -...
Microsoft Excel - Hide Unused Rows and Columns - Show only used cells ► • Excel - Hide Unused Rows and Columns - Sho...
Microsoft Excel - Click to Enter Data - Create Custom Spin Buttons ► • Excel - Click to Enter Data - Create Custo...
Excel - Save to Computer not OneDrive - Change the Excel default Save location ► • Excel - Save to Computer not OneDrive - Ch...
Excel - Personal Macro Workbook - what it is and how to create and use it ► • Excel - Personal Macro Workbook - what it ...
Excel - File Save Macro - A Smart Macro to Manage Saving Files Better ► • Excel - File Save Macro - A Cell's Content...
Excel - Charts that Don't Lie - Configure Sparklines to be Useful ► • Excel - Charts that Don't Lie - Configure ...
Word Calendar Wizard - Get the original Calendar Wizard to work in 2023 ► • Word Calendar Wizard - Setup to work in 20...
Excel Goal Seek - Find Answers Quickly & Easily ► • Excel Goal Seek - Find Answers Quickly & E...
Excel Chart for B & W Print & Photocopying - Grayscale Chart Formatting ► • Excel Chart for B & W Print & Photocopying...
Excel - Chart With 2 Axes - Add a 2nd Axis to a Chart & Control the Data Shown ► • Excel: Add a 2nd Y Axis to a Chart
Excel Data With ChatGPT - Create Data for Practice - for Teachers & Trainers► • Excel Data With ChatGPT - Create Data for ...
Excel - VBA File Open Macro - Make & Add to Ribbon for One Click Access► • Excel - VBA File Open Macro - Make & Add t...
#helenbradley #microsoftexcel #microsoftoffice #projectwoman