wildcatcrazy
New Member
- Joined
- Sep 20, 2011
- Messages
- 12
I have a simple macro that I recorded and then edited in VB. But, I would like to turn this into a loop so I do not have to make over a 1000 entries just to compare the remaining rows. What I need it to do is compare rows 2:3, 4:5, 6:7, so and so on to highlight the differences in the columns until it reaches the end of the data. When it does the compare, it needs to highlight the changes and move on to the next set of rows. I was able to duplicate these entries to compare all of the remaining rows (two at a time) until I got to around 500. Then Excel said I exceeded the limit.
Here is the macro I started with:
Sub Compare()
'
' Compare Macro
'
' Keyboard Shortcut: Ctrl+l
'
Rows("2:3").Select
Selection.ColumnDifferences(ActiveCell).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Here is the macro I started with:
Sub Compare()
'
' Compare Macro
'
' Keyboard Shortcut: Ctrl+l
'
Rows("2:3").Select
Selection.ColumnDifferences(ActiveCell).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub