Forum Discussion
crankcaller
Aug 16, 2023Copper Contributor
Duplicate Row if any data in particular cell
Hello, I have a spreadsheet of books. Roughly 3000 rows. Columns A to E are ISBN, Author etc. Columns F to N are Barcodes. Not all cells have barcodes. If the title has one copy then there ...
OliverScheurich
Aug 16, 2023Gold Contributor
Sub barcodes()
Dim i, j, k As Long
j = Range("A" & Rows.Count).End(xlUp).Row
For i = j To 2 Step -1
For k = 13 To 6 Step -1
If Cells(i, k).Value <> "" Then
Cells(i + 1, 1).EntireRow.Insert
Range(Cells(i + 1, 6), Cells(i + 1, 13)).Value = Range(Cells(i, 6), Cells(i, 13)).Value
Range(Cells(i + 1, 1), Cells(i + 1, 5)).Value = Range(Cells(i, 1), Cells(i, 5)).Value
Cells(i + 1, k).Clear
Else
End If
Next k
Next i
End SubDoes this code return a result similar to what you are looking for when you run the macro in the attached file?
crankcaller
Aug 16, 2023Copper Contributor
I have switched off my laptop. But I will check this I the morning. Thank you very much.