hello excel users.
i have a userform which populates the active cell with data entered inthe userform text box. however there is an issue if the active cell has data already present it should be shown in that text box. it is not doing that. so when i write anything in the text box it overrides the old data causing discrepencies.
when the active cell contains NJ:N=80,V6=0,V9=0, it should populate text box in user for NJ. and if active cell contains UV:N=140,V6=0,V9=0 then it should populate the textbox for UV.
Please help. attaching sample Excel
current code:
Private Sub CommandButton1_Click()
Dim s13 As String, s14 As String, s15 As String, sTxt
Dim d16 As String, d17 As String, d18 As String, dTxt
s13 = Me.TextBox13
s14 = Me.TextBox14
s15 = Me.TextBox15
d16 = Me.TextBox16
d17 = Me.TextBox17
d18 = Me.TextBox18
If s13 <> "" And s14 <> "" And s15 <> "" Then
sTxt = "NJ:N=" & s13 & ",V6=" & s14 & ",V9=" & s15
ActiveCell = sTxt
End If
If d16 <> "" And d17 <> "" And d18 <> "" Then
dTxt = "UV:N=" & d16 & ",V6=" & d17 & ",V9=" & d18
ActiveCell = dTxt
End If
Unload Me
End Sub
screenshots:
curent:
1.PNG
how it shoudl be:
NJ.PNG
UV.PNG
many tahnks for your help in this matter.
Bookmarks