View Single Post
  #4   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi

Assuming a Control toolbox textbox, if so it's no complication, but rather
"the way to do it".

Make its Keydown code look like this (in the worksheet module for a box on a
worksheet, in the userform module for a box on a userform):

Private Sub TextBox1_KeyDown(ByVal KeyCode _
As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If Shift = 2 Then 'Ctrl
Select Case KeyCode
Case 49 ' Ctrl 1
KeyCode = 0
TextBox1.SelText = _
"Harald says Hi!"
Case 50 'Ctrl 2
KeyCode = 0
TextBox1.SelText = _
"Harald says You're fired!"
Case Else
End Select
End If
End Sub

Now hold Ctrl while typing 1 or 2 into it and text is entered.
HTH. Best wishes Harald

"fsattar" skrev i melding
...
I write reports quite frequently and a lot of the sentences that I write

are
reprtitive. Therefore I am looking a way to optimize my time by automating
these sentences. A minor complication to this entire scenario is that my

text
is in a text box.
I could use some help on this. Please.
Thank you