If all formats have the same structure (the number "text" ), execute a small macro:
Sub ValueInFormat() Dim rRng As Range Dim i As Long With Worksheets("Лист1") i = .Cells(.Rows.Count, "B").End(xlUp).Row Set rRng = .Range("B1:B" & i) End With For i = 1 To rRng.Rows.Count With rRng(i, 1) If .Value = "" Then .Value = .Value & Split(.NumberFormat & """", """")(1) End With Next i rRng.NumberFormat = "@" Set rRng = Nothing End Sub
The code changes the values of the cells in the filled range in column B and sets the text format to the cells.
A little refinement - the source data will not change, the result will be recorded in a separate range:
Sub ValueInFormat() Dim aF() Dim rRng As Range Dim i As Long With Worksheets("Лист1") i = .Cells(.Rows.Count, "B").End(xlUp).Row Set rRng = .Range("B1:B" & i) aF = .Range("B1:B" & i).Value For i = 1 To UBound(aF) If aF(i, 1) <> Empty Then aF(i, 1) = aF(i, 1) & Split(rRng(i, 1).NumberFormat & """", """")(1) Next i .Range("D1").Resize(UBound(aF), 1).Value = aF End With Set rRng = Nothing End Sub
Code to place in the general module. VBA Editor Login - Alt+F11