I'm not sure what you are trying to exactly achieve but.... I don't think you have to select insert or replace....
- User inputs a hex value in TextBox1
- User Clicks button.
Code on button click will take hex value and ???? at the moment all I can assume it is going to output the text in Texbox2 as a html tag
Sub button1_click(sender as Object, e as EventArgs) Handles button1.click Dim outputString as String = "<font color='#" & TextBox1.Text & "'>Test Text</font>" TextBox2.Text = outputString End Sub