• 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.

how to add dot(.) after copying a single cell.

Shiv

New Member
hi
i have question... how to add dot(.) after copying a single cell.
i/p
sheet1
input1:no
input2:name
input3: Phone

o/p
sheet2
input1:no.
input2:name.
input3: Phone.

10Q.
 

Attachments

  • task1.xlsx
    9.5 KB · Views: 10
Only for the data provided.
Select the cell to copy then run the code
Code:
Sub test()
    Dim txt As String, r As Range
    txt = ActiveCell.Value
    Set r = Application.InputBox("Select cell to paste", Type:=8)
    With CreateObject("VBScript.RegExp")
        .Global = True
        .Pattern = "(([^:\d]+)\d*: *[^:.]+[^ \.])\.? *(?=(\2|$))"
        r.Value = .Replace(txt, "$1." & vbLf)
    End With
End Sub
 
Back
Top