Hi there I have this code that pulls data from one sheet and copies it to another sheet it loops through the sheet until there's no more data.
it pulls data from:
the end result of the code is the following:
but I want to tweak the code that if under revised breaker I type the same breaker name it will group it as shown in the picture below.
it pulls data from:
the end result of the code is the following:
but I want to tweak the code that if under revised breaker I type the same breaker name it will group it as shown in the picture below.
Code:
Dim lastrow2 As Long
Dim lastrow1 As Long
lastrow1 = pwbProject.Sheets("1.2 - TCC Coordination").Range("F" & pwbProject.Sheets("1.2 - TCC Coordination").Rows.Count).End(xlUp).Row
lastrow2 = 3
For i = 2 To lastrow1
If Len(pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, 6).Value) > 0 Then
'step through a lot of following columns for breaker settings changes
For j = 6 To 645 Step 5
If pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j).Value <> "" Then
pwbProject.Sheets("1.3 - Breaker Settings").Cells(lastrow2, 1).Value = pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j).Value
pwbProject.Sheets("1.3 - Breaker Settings").Cells(lastrow2, 2).Value = pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j + 1).Value
pwbProject.Sheets("1.3 - Breaker Settings").Cells(lastrow2, 3).Value = pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j + 2).Value & " = " & pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j + 3).Value
pwbProject.Sheets("1.3 - Breaker Settings").Cells(lastrow2, 4).Value = pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j + 2).Value & " = " & pwbProject.Sheets("1.2 - TCC Coordination").Cells(i, j + 4).Value
lastrow2 = lastrow2 + 1
End If
Next j
End If
Next i