arr_input = ActiveSheet.Range(Cells(startrow, startcol), Cells(lastrow, lastcol))
ActiveSheet.Range(Cells(startrow, startcol), Cells(lastrow, lastcol)).Style = "Normal" 'clear format
'get column numbers - dynamic header
Sheets("Template").Select
'ActiveSheet.Range(Cells(headerrow, startcol), Cells(headerrow, lastcol)).AutoFilter 'remove filter if there is any
'On Error GoTo header_cannotfount
Rows(headerrow).Select
With Selection ' dynamic header
col_cID = .Find(What:="ps_category_list_id", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_pname = .Find(What:="ps_product_name", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_pDes = .Find(What:="ps_product_description", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_pPrice = .Find(What:="ps_price", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_pStock = .Find(What:="ps_stock", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_Weight = .Find(What:="ps_product_weight", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
' col_Size = .Find(What:="ps_product_size", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_shipout = .Find(What:="ps_days_to_ship", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
'col_Image = .Find(What:="ps_img_id", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
' col_skuref = .Find(What:="ps_sku_ref_no", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
col_parentsku = .Find(What:="ps_sku_ref_no_parent", After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
' For img_i = 1 To 9
' col_img(img_i) = .Find(What:="ps_img_" & img_i, After:=Range(Cells(headerrow, startcol), Cells(headerrow, startcol)), LookIn:=xlValues).Column
' Next img_i
End With
On Error GoTo unidentifiederrors:
For i = 1 To (lastrow - startrow + 1)
'ignore blank rows
If Application.CountA(Cells(i + startrow - 1, 1).EntireRow) = 0 Then
GoTo blankrowend
End If