View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default When data in TextBox2 matches data in TextBox1

Dim sh as Worksheet
sh = Worksheets("Sheet2")
if Textbox2.Text = TextBox1.Text then
sh = Worksheets("Sheet1")
End if
' no use sh as your reference for writing your data.

--
Regards,
Tom Ogilvy

"Maddoktor" wrote in message
...
Hi all,

I have developed a userform that when the user clicks the OK button, the
data entered is dumped onto Sheet2.

I would like for the data, once entered, that if the data into TextBox2 is
identical to the data entered into TextBox1, then all data should be

dumped
onto Sheet1 instead.

What coding would I need to add to solve this problem.

Thanx in advance.