Dear all,
On my userform, the command "save" which is supposed to overwrite in the excel datasheets the changes made through the userform does not work. It works only on the few last reference but not on any of them. My knowledge in VBA being more than limited, could you have a look and tell me where is the mistake
here is the code
[CODE][/Private Sub SAVECMD_Click()
Dim IROW As Long
Dim IROW1 As Long
Dim WSH As Worksheet
Dim WSH1 As Worksheet
Set WSH = Worksheets("RECAP")
Set WSH1 = Worksheets("PRICING FINAL")
IROW = WSH.Cells.Find(WHAT:=Me.REF.Value, LookIn:=xlValues, SearchOrder:=xlRows, SearchDirection:=xlPrevious).Row
IROW1 = WSH1.Cells.Find(WHAT:=Me.REF.Value, LookIn:=xlValues, SearchOrder:=xlRows, SearchDirection:=xlPrevious).Row
Me.REF.Value = WSH.Cells(IROW, "C").Value
WSH.Cells(IROW, "A").Value = Me.MONTH.Value
WSH.Cells(IROW, "D").Value = Me.OIC.Value
WSH.Cells(IROW, "E").Value = Me.VSL.Value
WSH.Cells(IROW, "F").Value = Me.GRADE.Value
WSH.Cells(IROW, "G").Value = Me.LP.Value
WSH.Cells(IROW, "I").Value = Me.CT_QTY.Value
WSH.Cells(IROW, "J").Value = Me.TOLERANCE.Value
WSH.Cells(IROW, "L").Value = Me.SUPPLIER.Value
WSH.Cells(IROW, "M").Value = Me.TERM_P.Value
WSH.Cells(IROW, "N").Value = Me.CT_DATES_TERM.Value
WSH.Cells(IROW, "O").Value = Me.CT_DATES.Value
WSH.Cells(IROW, "R").Value = Me.LP_INSP.Value
WSH.Cells(IROW, "S").Value = Me.LP_INSP_SHARING.Value
WSH.Cells(IROW, "U").Value = Me.LP_AGT.Value
WSH.Cells(IROW, "V").Value = Me.LP_AGT_CATEGORY.Value
WSH.Cells(IROW, "W").Value = Me.RCVRS.Value
WSH.Cells(IROW, "X").Value = Me.TERMS_S.Value
WSH.Cells(IROW, "Y").Value = Me.DP.Value
WSH.Cells(IROW, "Z").Value = Me.REQ_MIN_QTY.Value
WSH.Cells(IROW, "AA").Value = Me.REQ_MAX_QTY.Value
WSH.Cells(IROW, "AD").Value = Me.DP_INSP.Value
WSH.Cells(IROW, "AE").Value = Me.DP_INSP_SHARING.Value
WSH.Cells(IROW, "AG").Value = Me.DP_AGT.Value
WSH.Cells(IROW, "AH").Value = Me.DP_AGT_CATEGORY.Value
WSH.Cells(IROW, "AI").Value = Me.BL_DATE.Value
WSH.Cells(IROW, "AJ").Value = Me.COD_DATE.Value
WSH.Cells(IROW, "AK").Value = Me.BL_GROSS_QTY.Value
WSH.Cells(IROW, "AL").Value = Me.BL_NET_QTY.Value
WSH.Cells(IROW, "AM").Value = Me.OT_QTY.Value
WSH1.Cells(IROW1, "M").Value = Me.INV_QTY_P.Value
WSH1.Cells(IROW1, "O").Value = Me.PRICING_P.Value
WSH1.Cells(IROW1, "P").Value = Me.PMT_P.Value
WSH1.Cells(IROW1, "R").Value = Me.OSP_P.Value
WSH1.Cells(IROW1, "S").Value = Me.PREM_P.Value
WSH1.Cells(IROW1, "AE").Value = Me.INV_QTY_S.Value
WSH1.Cells(IROW1, "AG").Value = Me.PRICING_S.Value
WSH1.Cells(IROW1, "AH").Value = Me.PMT_S.Value
WSH1.Cells(IROW1, "AJ").Value = Me.OSP_S.Value
WSH1.Cells(IROW1, "AK").Value = Me.PREM_S.Value
WSH1.Cells(IROW1, "BB").Value = Me.MIN_FRT_QTY.Value
WSH1.Cells(IROW1, "BC").Value = Me.WS.Value
End Sub
CODE]
Bookmarks