VBA code string with more then 912 characters

[Closed]
Report
-
 Guy -
Hello,

I have created a VBA code with a string of character exceeding the number of 912, thus getting the error 1004.

The code looks like this:
Sheets("Verlofoverzicht").Range("M8:N8,M9:N9,M10:N10,M11:N11,......,M199:N199,M200:N200").Merge

What do I need to do to make my code work.

I already checked the support site of microsoft, but can't find a suitable answer.

Can anyone help me out?

Best regards,
Wiebe

1 reply

Use this

Sub test()
For i = 8 To 200
Range(Cells(i, 13), Cells(i, 14)).Merge
Next i
End Sub