How to align all common list in excel?
Solved/Closed
ehlblackstar
Posts
11
Registration date
Monday April 5, 2010
Status
Member
Last seen
November 2, 2018
-
Apr 5, 2010 at 10:16 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 8, 2010 at 07:04 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 8, 2010 at 07:04 AM
Related:
- How to align all common list in excel?
- How to change your best friends list on snapchat to 3 - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Counter strike 1.6 cheats list - Guide
- Amd crossfire gpu list - Guide
- Liste déroulante excel anglais - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 5, 2010 at 04:48 PM
Apr 5, 2010 at 04:48 PM
Assumptions
1. The max rows of data is found in column A
2. At the time of execution of macro, the active sheet is the sheet with data
1. The max rows of data is found in column A
2. At the time of execution of macro, the active sheet is the sheet with data
Sub AlignAndAccount()
Dim lMaxRows As Long
Dim lRowBeanCounter As Long
Columns("A:B").Select
Selection.Sort _
Key1:=Range("A2"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Columns("C:D").Select
Selection.Sort _
Key1:=Range("C2"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
Cells(1, "E") = "Value"
For lRowBeanCounter = 2 To lMaxRows
Select Case Cells(lRowBeanCounter, "A")
Case Is = Cells(lRowBeanCounter, "C")
If (Cells(lRowBeanCounter, "B") = Cells(lRowBeanCounter, "D")) Then
Cells(lRowBeanCounter, "E") = "TRUE"
Else
Cells(lRowBeanCounter, "E") = "FALSE"
End If
Case Is < Cells(lRowBeanCounter, "C")
Range("C" & lRowBeanCounter & ":D" & lRowBeanCounter).Select
Selection.Insert Shift:=xlDown
'Cells(lRowBeanCounter, "E") = "FALSE"
Case Else
Range("A" & lRowBeanCounter & ":B" & lRowBeanCounter).Select
Selection.Insert Shift:=xlDown
lMaxRows = lMaxRows + 1
End Select
Next lRowBeanCounter
End Sub
Apr 8, 2010 at 05:57 AM
Apr 8, 2010 at 07:04 AM