TkdKidSnake
Board Regular
- Joined
- Nov 27, 2012
- Messages
- 245
- Office Version
- 365
- Platform
- Windows
Hi all,
I am trying to insert copied cells into another spreadsheet based on the value changing in column A, if it changes the rows are inserted underneath the 1st value and before the 2nd value. What I have currently is the below however I am seeing some anomalies.
The codes is activitate whilst in the correct worksheet
If anyone can see where I have gone wrong it would be greatly appreciated, also the data starts at A3 and currently this stating from the very 1st cell and inserting immediately
Thanks in advance
I am trying to insert copied cells into another spreadsheet based on the value changing in column A, if it changes the rows are inserted underneath the 1st value and before the 2nd value. What I have currently is the below however I am seeing some anomalies.
The codes is activitate whilst in the correct worksheet
Code:
Dim bRow As Long
For bRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row To 3 Step -1
If Cells(bRow, "A") <> Cells(bRow - 1, "A") Then
Rows(bRow).Resize(5).EntireRow.Insert
Windows("OTIF Dashboard.xlsm").Activate
Sheets("OTIF Detail").Rows("5:11").Copy
Windows("RawData.csv").Activate
Range("A" & bRow).PasteSpecial (xlPasteAll)
If anyone can see where I have gone wrong it would be greatly appreciated, also the data starts at A3 and currently this stating from the very 1st cell and inserting immediately
Thanks in advance