The below code is working uses formula to concatenate the result from Range("K:M")
and write the result in column H.
Is there a better way to write the below code that can concatenate the result to the exact location as per below table? Please note that data in the before table is discontinued but sometimes will be from row 4 to 1000 rows down or the below example.
Sub GenerateStyleFabricColourV4()
Dim srcData As Range
Dim rowNum As Long, lastRow As Long
With Worksheets(2)
lastRow = Application.Max(4, _
.Cells(.Rows.Count, "K").End(xlUp).Row, _
.Cells(.Rows.Count, "L").End(xlUp).Row, _
.Cells(.Rows.Count, "M").End(xlUp).Row)
With .Cells(4, "H").Resize(lastRow - 4 + 1, 1)
.FormulaR1C1 = "=rc[3]&rc[4]&rc[5]"
.Value = .Value2
End With
End With
End Sub
Sub ClearAllData()
Rows("4:" & Rows.Count).ClearContents
End Sub
range.currentregion
instead of the multipleend(xlup)
calls. \$\endgroup\$