Okay, I have 2 questions that fall under this same topic, I think the workaround will probably be the same for both, but I'm not sure
Question1:
I have the following code
For Each cell In Range("D8:D11")
If cell.Value <= Range("M2").Value Then
Cells(cell.Row, 13).Value = Me.TextBox1.Value
End If
Next
What the code is doing:
If D8 <= M2 then textbox1.value is being written to M8, M9, M10, M11
If D9 <= M2 then textbox1.value is being written to M8, M9, M10, M11
and so on....
What I'm trying to do:
If D8 <= M2 then write textbox1.value to M8
If D9 <= M2 then write textbox1.value to M9
and so on...
How do I get my range(D8:D11) to write to their respective cells in range(M8:M11) without update the rest of the cells in M8:M11
Question 2:
In the next code
For Each cell In Range("N2:EK2")
If cell.Value = Range("D8").Value Then
Cells(8, cell.Column).Value = Me.TextBox1.Value
End If
If cell.Value = Range("D9").Value Then
Cells(9, cell.Column).Value = Me.TextBox1.Value
End If
If cell.Value = Range("D10").Value Then
Cells(10, cell.Column).Value = Me.TextBox1.Value
End If
If cell.Value = Range("D11").Value Then
Cells(11, cell.Column).Value = Me.TextBox1.Value
End If
Next
Me.Hide
Display More
The code works to where if D8 > M2, then a cell in N2:EK2 is populated with the textbox value if D8 = a column in N2:EK2
Unlike above, the textbox value for each cell in range D8:D11 is written seperately to it's appropriate row BUT to following occurs:
If row 8 user input: textbox1.value = "name1", then the appropriate cell in row 8 will contain "name1"
But if row 9 user input: text1.value = "name2", the appropriate cell in row 9 will contain "name2" AND the "name1" in row 8 will change to "name2"
How do recognize these as separate entities without having to create a new userform/textbox for each case?
Thank you excel experts for your time!