Get instant live expert help on I need help with excel vba len

“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Our professional experts are available now. Your privacy is guaranteed.

Here are some problems that our users have asked and received explanations on

I need help with some excel functions for an assignment, specifically Vlookup, Left, Len and Iferror
Solved by Z. A. in 25 mins
Sub ConcatWithStyles() Dim X As Long, Cell As Range, Text As String, Position As Long Range("A3").Value = Space(Evaluate("SUM(LEN(A1:F1))+COLUMNS(A1:F1)-1")) Position = 1 Application.ScreenUpdating = False For Each Cell In Range("A1:F1") With Range("A3") Characters(Position, Len(Cell.Value)).Text = Cell.Characters(1, Len(Cell.Value)).Text For X = 1 To Len(Cell.Value) With .Characters(Position + X - 1, 1).Font TintAndShade = Cell.Characters(X, 1).Font.TintAndShade FontStyle = Cell.Characters(X, 1).Font.FontStyle End With Next End With Position = Position + Len(Cell.Value) + 1 Next Application.ScreenUpdating = True End Sub
Solved by G. L. in 20 mins
len test on cell shows more characters than appearing. After a trim. The len test still shows more characters. Hence my vlook up not working
Solved by X. E. in 22 mins
Hi there, could you please tell me what is wrong with this function: =IFERROR(VLOOKUP(LEFT(A4,4)&"_"&B4&"_"LEN(A4:B4),CustomerTable,2,FALSE),0). It is returning an error value and I am pretty sure it is to do with the LEN section but can't work it out
Solved by C. J. in 21 mins
Sub ConcatWithStyles() Dim X As Long, Cell As Range, Text As String, Position As Long Range("A3").Value = Space(Evaluate("SUM(LEN(A1:F1))+COLUMNS(A1:F1)-1")) Position = 1 Application.ScreenUpdating = False For Each Cell In Range("A1:F1") With Range("A3") .Characters(Position, Len(Cell.Value)).Text = Cell.Characters(1, Len(Cell.Value)).Text For X = 1 To Len(Cell.Value) With .Characters(Position + X - 1, 1).Font .Name = Cell.Characters(X, 1).Font.Name .Size = Cell.Characters(X, 1).Font.Size .Color = Cell.Characters(X, 1).Font.Color .Strikethrough = Cell.Characters(X, 1).Font.Strikethrough End Sub
Solved by D. Q. in 23 mins