• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

changing one character in a range to windings

Belleke

Well-Known Member
if the character is è or ì I would like these two characters change to windings. this in cells with more text ,the rest of the text should remain Arial
 
According to the Macro Recorder for starters :​
Code:
Sub Macro1()
    Dim S&
    For S = 1 To ActiveCell.Characters.Count
        With ActiveCell.Characters(S, 1)
            Select Case .Text
                   Case "è", "ì":   .Font.Name = "Wingdings"
            End Select
        End With
    Next
End Sub
Do you like it ? So thanks to click on bottom right Like !​
 
It works fine but i would like to use a range instead of active cell (always the same range)
 
In case your range has several cells then according to VBA basics apply a For Each loop on the range​
and use the loop variable instead of ActiveCell obviously …​
 
Adapted:
Code:
Sub Macro1()
Dim S&
For Each cll In Range("A1:C9").Cells    'adjust this range to suit.
  For S = 1 To cll.Characters.Count
    With cll.Characters(S, 1)
      Select Case .Text
        Case "è", "ì":   .Font.Name = "Wingdings"
      End Select
    End With
  Next S
Next cll
End Sub
 
Back
Top