mike637
asked on
Merge cells in range
Hello Experts,
I thought I knew what I was doing - but NO. I am trying to merge cells quickly.
On my sheet I have Range("K7:BA7") that I need to merge. (K7&L7, then M7&N7 etc.)
Here is my code:
Dim i As Long
For i = 11 To 45 Step 2
Sheet7.range(cells(7, i), cells(7, i + 1)).merge
Next i
However I am getting an error code 1004 - I do not know what I am doing wrong.
Can you please correct me which will educate me, as well.
Thank you!
I thought I knew what I was doing - but NO. I am trying to merge cells quickly.
On my sheet I have Range("K7:BA7") that I need to merge. (K7&L7, then M7&N7 etc.)
Here is my code:
Dim i As Long
For i = 11 To 45 Step 2
Sheet7.range(cells(7, i), cells(7, i + 1)).merge
Next i
However I am getting an error code 1004 - I do not know what I am doing wrong.
Can you please correct me which will educate me, as well.
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will remember next time. I knew this, I just forgot.