(Solved) – Joining a range in VBA throwing type mismatch

  • by
(solved)-–-joining-a-range-in-vba-throwing-type-mismatch

Please help with this, I am trying to simply concatenate the first row of a sheet into a list separated by commas but it is throwing the type mismatch error. All values in the cells are strings and there is a value in every cell. I have tried declaring headers to a variant as well.

lc = Cells(1, Columns.Count).End(xlToLeft).column
headers = Join(Range(Cells(1, 1), Cells(1, lc)), ",")

Debug.Print headers

Leave a Reply

Your email address will not be published. Required fields are marked *