Good afternoon,
I have written the following code:
Sub NewPO()
'Cleardown unused PO numbers
Range("e" & Rows.Count).End(xlUp).Offset(1, 0).Select
Selection.EntireRow.ClearContents
'Generate new PO number based on last number in coloumn "i"
Range("P4").Value = "GG" & Range("I" & Rows.Count).End(xlUp).Value + 1 & Range("P2").Value
'Copy New PO into Relevant PO box
Range("J" & Rows.Count).End(xlUp).Offset(1, 0).Value = "GG" & Range("I" & Rows.Count).End(xlUp).Value + 1 & Range("P2").Value
'Copy last number into last cell of column "i"
Range("i" & Rows.Count).End(xlUp).Offset(1, 0).Value = Range("I" & Rows.Count).End(xlUp).Value + 1
End Sub
I am having issues with the first section (in Bold). What I am trying to do is find the last populated cell in column E, drop down one cell, and clear the contents in the row. For some reason it doesn't clear any text in the relevant cells in that row?
Can anyone see why?
Many thanks
I have written the following code:
Sub NewPO()
'Cleardown unused PO numbers
Range("e" & Rows.Count).End(xlUp).Offset(1, 0).Select
Selection.EntireRow.ClearContents
'Generate new PO number based on last number in coloumn "i"
Range("P4").Value = "GG" & Range("I" & Rows.Count).End(xlUp).Value + 1 & Range("P2").Value
'Copy New PO into Relevant PO box
Range("J" & Rows.Count).End(xlUp).Offset(1, 0).Value = "GG" & Range("I" & Rows.Count).End(xlUp).Value + 1 & Range("P2").Value
'Copy last number into last cell of column "i"
Range("i" & Rows.Count).End(xlUp).Offset(1, 0).Value = Range("I" & Rows.Count).End(xlUp).Value + 1
End Sub
I am having issues with the first section (in Bold). What I am trying to do is find the last populated cell in column E, drop down one cell, and clear the contents in the row. For some reason it doesn't clear any text in the relevant cells in that row?
Can anyone see why?
Many thanks