Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stripey Spreadsheet Macro/VB script 1

Status
Not open for further replies.

dom747

Technical User
Jun 28, 2001
23
DE
Is it possible to create a Macro in Excel 2000 to produce a striped spreadsheet (eg. first row yellow, second row white, third row yellow) without reformatting the cells and only for the areas in the spreadsheet where data has been enetered ?

 
try

Sub Macro1()
For i = 1 To 100 Step 2
Rows(i).Select
With Selection.Interior
.Color = RGB(255, 0, 0)
.Pattern = xlSolid
End With
Next i
End Sub

The color is specified by the RGB call.
You can modify the selection range i.e. rows(..).select to
control the area you want to highlight.
 


Hi dom747


Use conditional formating

"formula is" set to:
=(MOD(ROW(),2)=0)
(dont forget to change formatting for when it is true)

Then, just record a macro.


Stew

"Even a stopped clock tells the right time twice a day."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top