If RichTextBox1.Focused = true Then
RichTextBox1.Undo()
End If
If RichTextBox2.Focused = true Then
RichTextBox2.Undo()
End If
it's a basic,
first you check the focus 'on' of the first RTBox, then for the second RTBox.
'Better' is an enemy for the 'good' : 'elseif' are not simple to master.