A
A
Alexander Daring2019-05-01 01:04:23
Macros
Alexander Daring, 2019-05-01 01:04:23

Macro which for each value in a cell before and after adds text?

If there was such a value in an Excel cell: ML XL
Then you need this:
select:Size:M:+0.0000:0:0:+0.00000000:1|select:Size:L:+0.0000:0:0:+0.00000000:1| select:Size:XL:+0.0000:0:0:+0.00000000:1|

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pychev Anatoly, 2019-05-01
@pton

And what do you need help with?
Where is an example of your operating time, in which something does not work out for you?

A
Alexander Derzkoy, 2019-05-01
@San4oPan40a

In case it comes in handy for someone:

Private Sub Test() 'http://www.cyberforum.ru/vba/thread2445785.html
    Const template = "|select:Размер:<SIZE>:+0.0000:0:0:+0.00000000:1"
 
    Dim a, e, i&, t1$, t2$, cNBS$, cS$: cNBS = Chr$(160): cS = Chr$(32)
    a = Range(Cells(2, "A"), Cells(Rows.Count, "A").End(xlUp)).Value
    For i = 1 To UBound(a)
        t1 = Format$(Trim$(a(i, 1)), "0,000")
        t1 = Replace(t1, cNBS, cS) 'можно записать в одну строку
        For Each e In Split(t1)
            t2 = t2 & Replace(template, "<SIZE>", e)
        Next
        a(i, 1) = Mid$(t2, 2): t2 = ""
    Next
    Cells(2, "B").Resize(i - 1) = a 'Результат в соседний столбец (для наглядности)
End Sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question