Compare two blank cells
Closed
Demolisher
-
Aug 3, 2009 at 03:27 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 4, 2009 at 06:46 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 4, 2009 at 06:46 AM
Related:
- Compare two blank cells
- Beyond compare - Download - File management
- Based on the values in cells b77 b81 ✓ - Excel Forum
- Excel compare two sheets - Guide
- How would you change all cells containing the word pass to green - Excel Forum
- Based on the cell values in cells b77 - Excel Forum
3 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 3, 2009 at 05:54 AM
Aug 3, 2009 at 05:54 AM
ty this type of macro
if you want to compare many cells put it in a loop.
Sub test() If Worksheets("sheet1").Range("a1") = "" And Worksheets("sheet2").Range("a1") = "" Then Worksheets("sheet3").Range("a1") = "" ElseIf Worksheets("sheet1").Range("a1") = Worksheets("sheet2").Range("a1") Then Worksheets("sheet3").Range("a1") = "true" Else Worksheets("sheet3").Range("a1") = "false" End If End Sub
if you want to compare many cells put it in a loop.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 4, 2009 at 06:46 AM
Aug 4, 2009 at 06:46 AM
try this macro . study the code statements. You can see the logic and next time if you want to write a loop it will help you
If there is any bug post back
If there is any bug post back
Sub TEST1() Dim rng As Range, c As Range, rng2 As Range, rng3 As Range Dim j As Integer, k As Integer Worksheets("sheet3").Cells.Clear Worksheets("sheet1").Activate Set rng = Range(Range("A1"), Cells(Rows.Count, "a").End(xlUp)) For Each c In rng j = c.Row k = c.Column Set rng2 = Worksheets("sheet2").Cells(j, k) Set rng3 = Worksheets("sheet3").Cells(j, k) If c = "" And rng2 = "" Then rng3 = "" ElseIf c = rng2 Then rng3 = "True" Else rng3 = "false" End If Next c End Sub