Results 1 to 8 of 8

Thread: Add dashes between letters

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    623
    Location
    I reduced your existing macro to :

    Option Explicit
    
    Sub AddDashes1()
        Dim Cell As Range
        Dim sTemp As String
        Dim C As Integer
        For Each Cell In Selection
            sTemp = ""
            For C = 1 To Len(Cell)
                sTemp = sTemp + Mid(Cell, C, 1) + "-"
            Next
            Cell.Value = Left(sTemp, Len(sTemp) - 1)
        Next
    End Sub
    Select the cell and click the button.
    Last edited by Aussiebear; 07-08-2025 at 06:30 PM.

Posting Permissions

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