Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2008
    Posts
    36
    Thanks
    4
    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. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 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. #3
    Lounger
    Join Date
    Jul 2008
    Posts
    36
    Thanks
    4
    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
  •