Kmahraz
Member
Hi-
I am looking for some assistance with my code below, the code work perfectly with one exception.
I have a Userform that I use to retrieve and update records, when I retrieve a record and make changes in my userform and press update I would like my code to update all rows associated with the same customer ID rather than updating only the first row for that specific customer in sheet 5 specifically.
please see image below:
PS: The columns I am targeting are
BCDE
JKLM
RSTU
Any help will be much appreciated!
-K-
Sample file :
https://www.dropbox.com/s/iqpdwbdi9l5t29x/xlstime.xlsm?dl=0
I am looking for some assistance with my code below, the code work perfectly with one exception.
I have a Userform that I use to retrieve and update records, when I retrieve a record and make changes in my userform and press update I would like my code to update all rows associated with the same customer ID rather than updating only the first row for that specific customer in sheet 5 specifically.
please see image below:
PS: The columns I am targeting are
BCDE
JKLM
RSTU
Any help will be much appreciated!
-K-
Sample file :
https://www.dropbox.com/s/iqpdwbdi9l5t29x/xlstime.xlsm?dl=0
Code:
l= Sheet5.Cells(Rows.Count, "C").End(xlUp).Row
Set fnd = Sheet5.Range("A3:A" & l)
'Set rng = fnd.Find(What:=Me.ListBox1.List(i), LookIn:=xlFormulas) 'Grasor says 'i' not set to anything.For i = 0 To Me.ListBox1.ListCount - 1
If ListBox1.Selected(i) = TrueThen
Set rng = fnd.Find(What:=Me.ListBox1.List(i), LookIn:=xlFormulas)
EndIf
Next i
OnErrorResumeNext
c = rng.Row
If rng IsNothingThen
MsgBox "No match found on Fittings Cost Data tab.", vbInformation
ExitSub
EndIf
With Me
'<~~ OVERRIDE DATA FOR WELDED FITTINGS~~~> rng.Offset(0, 1) = .cboWSSystem
rng.Offset(0, 2) = .cboWUnit
rng.Offset(0, 3) = .cboWCurrency
rng.Offset(0, 4) = .cboWMaterial
'<~~ OVERRIDE DATA FOR THREADED FITTINGS~~~> rng.Offset(0, 9) = .cboTSSystem
rng.Offset(0, 10) = .cboTUnit
rng.Offset(0, 11) = .cboTCurrency
rng.Offset(0, 12) = .cboTMaterial
'<~~ OVERRIDE DATA FOR SWAGELOK FITTINGS~~~> rng.Offset(0, 17) = .cboSSSystem
rng.Offset(0, 18) = .cboSUnit
rng.Offset(0, 19) = .cboSCurrency
rng.Offset(0, 20) = .cboSMaterial