merge cell macro

plost33

Well-known Member
Joined
Oct 2, 2008
Messages
866
I am in need of a macro that will start on row 18 and merge column E and F together. i needs to start on row 18 and go thru row 5000.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
That should be easily recordable.

But why do you want to merge cells? It's generally not recommended.
 
Upvote 0

BAlGaInTl

Well-known Member
Joined
May 7, 2003
Messages
1,082
I agree that it really isn't recommended, but this code will do what you are looking for:

Code:
Sub MergeCells()
Dim i As Long
For i = 18 To 5000
    Range("E" & i & ":F" & i).Merge
Next i
End Sub
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Sub test()
Dim i As Long
For i = 18 To 5000
    Range("E" & i & ":F" & i).Merge
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,216
Messages
5,985,319
Members
439,957
Latest member
khaled shafy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top