Herés the modified code:
Sub XML_Data_Macro()
'
' XML_Data_Macro Macro
'
Dim lstRow As Long '* variable to hold the last row
lstRow = Cells(Rows.Count, 1).End(xlUp).Row '* find the last filled row
If Len(Trim(Cells(lstRow, 1).Value)) > 0 Then lstRow = lstRow + 1 '* if this is > 1 then add 1
Cells(lstRow, 1).Value = Format(Now(), "dd/mm/yyyy hh:mm") '* place timestanp in column A
Range("B" & lstRow).Select
ActiveWorkbook.XmlImport URL:="C:\Users\Jon\Desktop\books.xml", ImportMap:= _
Nothing, Overwrite:=True, Destination:=Range(Range("B" & lstRow))
Cells.Columns.AutoFit
End Sub
Bookmarks