blackie42
01-20-2017, 05:34 AM
Hi,
Want to copy contents of cells in column K (sheet1), insert LEFT function (9) and copy to sheet2 column B. Following code looks
like it should work but only copies the first item i.e. K1 to B1
Sub COPYLEFT()
Dim cell As Range
Dim sourceRange As Range
Set sourceRange = Range(Sheets("Sheet1").Range("K1"), Selection.End(xlDown))
For Each cell In sourceRange
If IsEmpty(cell.Value) Then Exit For
Sheets("Sheet2").Range("B" & cell.Row).Value = Left$(cell.Value, 9)
Next
End Sub
Any help appreciated
thanks
Jon
Want to copy contents of cells in column K (sheet1), insert LEFT function (9) and copy to sheet2 column B. Following code looks
like it should work but only copies the first item i.e. K1 to B1
Sub COPYLEFT()
Dim cell As Range
Dim sourceRange As Range
Set sourceRange = Range(Sheets("Sheet1").Range("K1"), Selection.End(xlDown))
For Each cell In sourceRange
If IsEmpty(cell.Value) Then Exit For
Sheets("Sheet2").Range("B" & cell.Row).Value = Left$(cell.Value, 9)
Next
End Sub
Any help appreciated
thanks
Jon