Tuesday, July 15, 2014

Quick Macro for Scanning PeopleCode Compare Reports

Today I am preparing for our Upgrade and I was doing some analysis on the Record PeopleCode Compare reports that I had saved as Tab Delimited text files and imported into excel.  What I was doing was analyzing the deltas and documenting the event I found them.  This analysis would occasionally require me to scroll 100's of excel rows without finding a change in event or code!  This was starting to frustrate me.

Compare Report for Record PeopleCode

What I needed was a Macro that could scan the report for me and stop on either the column 1 having a value or column 8 having a value; both are highlighted in red above.  This was my simple Macro that I executed when I wanted to quickly scan to the next change or to the next event.

Sub scan()
Dim i As Long
Dim s As Long
Dim o As Long
 s = ActiveCell.Row
 For i = ActiveCell.Row To Rows.Count
  
 If Cells(i, 8).Value > " " Or Cells(i, 1) > " " Then
  o = i - s + 1
  ActiveCell.Offset(o, 0).Select
  
  Exit For
 End If

Next i
End Sub

No comments:

Post a Comment