Advertisement
eeperry

LibreOffice Calc Macro: Highlight Even Rows

Sep 30th, 2012
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '*************** HighlightEven *******************
  2. 'hightlights the even rows in a light gray color
  3. '*************************************************
  4. Sub HighLightEven
  5.     dim Selection as Object
  6.     dim Rows as Object
  7.     dim Row as Object
  8.     dim Cols as Object
  9.     dim Cell as Object
  10.     dim i as Integer
  11.     dim j as Integer
  12.    
  13.     Selection = ThisComponent.CurrentSelection
  14.     Rows = Selection.Rows
  15.     Cols = Selection.Columns
  16.     for i = 1 to Rows.Count - 1 Step 2
  17.         for j = 0 to Cols.Count - 1
  18.             Cell = Selection.getCellByPosition(j,i)
  19.             Cell.CellBackColor = &HBBBBBB
  20.         Next
  21.     Next
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement