Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Comparing Entity, GREN and IC in order to compile the data for the entities
- Dim entity_1, entity_2 As String
- Dim GREN_1, GREN_2 As String
- Dim IC_1, IC_2 As String
- Dim last_row_of_FC_OUTPUT, first As Integer
- Dim second As Integer
- Dim V_1 As Range
- Dim V_2 As Range
- Dim entity_comp, GREN_comp, IC_comp As Integer
- Set V_1 = Application.Sheets("FC_OUPUT").Range("L1:CR1").Offset(first, 0)
- Set V_2 = Application.Sheets("FC_OUPUT").Range("L1:CR1").Offset(second, 0)
- first = 7 'First row with data
- second = 8 'Second row with data
- entity_1 = Application.Sheets("FC_OUTPUT").Range("D1").Offset(first, 0).Value
- entity_2 = Application.Sheets("FC_OUTPUT").Range("D1").Offset(second, 0).Value
- GREN_1 = Application.Sheets("FC_OUTPUT").Range("H1").Offset(first, 0).Value
- GREN_2 = Application.Sheets("FC_OUTPUT").Range("H1").Offset(second, 0).Value
- IC_1 = Application.Sheets("FC_OUTPUT").Range("I1").Offset(first, 0).Value
- IC_2 = Application.Sheets("FC_OUTPUT").Range("I1").Offset(second, 0).Value
- last_row_of_FC_OUTPUT = Range("Last_row_dump").Value + 1
- entity_comp = StrComp(entity_1, entity_2, 1)
- GREN_comp = StrComp(GREN_1, GREN_2, 1)
- IC_comp = StrComp(IC_1, IC_2, 1)
- For first = 7 To last_row_of_FC_OUTPUT
- Application.StatusBar = "Compiling rows " & first - 7
- For second = first + 1 To last_row_of_FC_OUTPUT
- If entity_comp + GREN_comp + IC_comp = 0 Then
- V_1.Value = V_1.Value + V_2.Value
- Rows(second).Select.Delete
- End If
- Next second
- Next first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement