-
I changed to
[VBA]
Sub GenerateCodes()
Dim num As String
Dim txt
Dim str As String
Dim cnt As Long
Dim rngA As Range
Dim rngB As Range
Dim cel As Range
Set rngA = ActiveSheet.Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
Set rngB = ActiveSheet.Range(Range("B1"), Range("B" & Rows.Count).End(xlUp))
For Each cel In rngB
txt = Split(cel.Value, " ")
For cnt = LBound(txt) To UBound(txt)
str = str + Left(txt(cnt), 1)
Next cnt
ActiveSheet.Range("C" & cel.Row) = _
str & "-" & Right(ActiveSheet.Range("A" & cel.Row), 5)
str = ""
Next cel
End Sub
[/VBA]
And Worked . Thank you very much for your big help .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules