I do not understand why you use 'Let'. The use of it has become redundant for more than 20 years.
To 'walk' in your approach:
orCode:Sub M_snb() sn = Sheet1.Cells(1).CurrentRegion For j = 2 To UBound(sn) For jj = 1 To UBound(sn, 2) c00 = c00 & IIf(jj = 1, sn(j, jj) & ";", """" & IIf(jj = 4, Format(sn(j, jj), "0.00"), sn(j, jj)) & """;") Next c00 = c00 & vbLf Next MsgBox Replace(c00, ";" & vbLf, vbLf) End Sub
Code:Sub M_snb_002() sn = Sheet1.Cells(1).CurrentRegion For j = 2 To UBound(sn) c00 = c00 & """" & vbLf & Replace(Join(Application.Index(sn, j), """;"""), """", "", , 1) Next MsgBox Replace(Mid(c00, 3), """0""", """0,00""") End Sub




Reply With Quote
Bookmarks