Macro for coloring cells depending on values and presenting them
Closed
PeriGr
Posts
11
Registration date
Monday July 17, 2017
Status
Member
Last seen
August 12, 2017
-
Jul 17, 2017 at 08:22 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 18, 2017 at 12:09 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 18, 2017 at 12:09 PM
Related:
- Macro for coloring cells depending on values and presenting them
- Excel macro to create new sheet based on value in cells - Guide
- Spell number in excel without macro - Guide
- What color is audio out on pc - Guide
- Run macro when cell value changes by formula ✓ - Excel Forum
- How would you change all cells containing the word pass to green - Excel Forum
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jul 18, 2017 at 12:09 PM
Jul 18, 2017 at 12:09 PM
Hi PeriGr,
In the code below the source sheet is called Sheet1 and the destination sheet is called Sheet2.
Here is the code:
Best regards,
Trowa
In the code below the source sheet is called Sheet1 and the destination sheet is called Sheet2.
Here is the code:
Sub RunMe() Dim mDiff As Double mDiff = 0.05 Sheets("Sheet1").Select For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row) If cell.Value - cell.Offset(0, 1).Value > mDiff Or cell.Offset(0, 1).Value - cell.Value > mDiff Then cell.EntireRow.Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) cell.EntireRow.Interior.ColorIndex = 3 End If Next cell End Sub
Best regards,
Trowa