I am trying to concatenate cells as per below VBA script but it gives me run-time error '91' - Object variable or With Block variable not set. I guess that's smth to do with variable "x"? Can anyone help please?
Sub Macro1()
Dim Cells As Range
Dim x As Integer
x = 2
Do While Cells(x, 1) <> ""
Cells(x, 2) = Cells(x, 2) & Cells(x, 3) & Cells(x, 4)
Cells(x, 2) = ""
x = x + 1
Loop
Columns("B:B").EntireColumn.AutoFit
End Sub
Dim Cells As Range.Cells(x, 2) = ""- change that toRange("C" & x & ":D" & x).ClearContents.