Results 1 to 3 of 3
  • Thread Tools
  1. New Lounger
    Join Date
    Jul 2008
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi!
    I want to put a hat character on some letters that next to the cursor. For example:
    If the letter next to the cursor is small "a" then replace it for "â", If the letter next to the cursor is capital "A" then replace it for "Â" . Here is the others:
    CASES:
    i---> î
    I---> Î
    u---> û
    U---> Û

    Thanks ...

    Yken

  2. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Try this macro:

    Code:
    Sub AddHat()
      Dim rng As Range
      Set rng = Selection.Range
      If Len(rng.Text) = 0 Then
    	rng.MoveStart Count:=-1
    	Select Case rng.Text
    	  Case "a"
    		rng.Text = "â"
    	  Case "e"
    		rng.Text = "ê"
    	  Case "i"
    		rng.Text = "î"
    	  Case "o"
    		rng.Text = "ô"
    	  Case "u"
    		rng.Text = "û"
    	  Case "A"
    		rng.Text = "Â"
    	  Case "E"
    		rng.Text = "Ê"
    	  Case "I"
    		rng.Text = "Î"
    	  Case "O"
    		rng.Text = "Ô"
    	  Case "U"
    		rng.Text = "Û"
    	End Select
      End If
      Selection.Move Count:=1
    End Sub

  3. New Lounger
    Join Date
    Jul 2008
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much!

    Yken

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •