Merge Cells Help!!!!!

RoyCR

New Member
Joined
Aug 11, 2010
Messages
2
Hi I have a macro that runs and prepares a report but now I am required to give it a little make up.

The problem with the make up is that I need to merge 2 cells from 2 columns
range starts as of F8:G8 and should end when there is no more data on the rows below F8:G8.

I've been trying to it several ways but have not gotten any way to have it work. I just need it to keep merging cell F?:G? starting on F8:G8 until it faces to a blank row.

Does anyone has a quick and good guide or can help me with this?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I'd suggest going down the data until you find the blank cell you're looking for, then merge the cells between it and F8:G8 all in one go.

Have you any code you can post, to see where you're at?
 
Upvote 0
Does this work?

Code:
Sub testmerge()
Dim LRow As Long
LRow = Range("F65536").End(xlUp).Row
For i = 8 To LRow
    Range("F" & i & ":G" & i).Merge
Next
End Sub
 
Upvote 0
Hi and welcome to the board!!
Why would you possibly want to merge these cells?? It is really bad practice!
http://www.officearticles.com/excel/merged_cells_in_microsoft_excel.htm
Can you not use "Center Across Selection"??

That said
Code:
Sub MergeMe()
Dim cl As Range
Application.DisplayAlerts = False
For Each cl In Range("$F$8:$F" & Cells(Rows.Count, "F").End(xlUp).Row)
   Range(Cells(cl.Row, "F"), Cells(cl.Row, "G")).MergeCells = True
Next cl
Application.DisplayAlerts = True
End Sub

lenze
 
Upvote 0
Thanks for the quick help both of you. I was able to do all the merge but it kept going although I tried a dim range.

I am trying to do the merge because of printing "make up", now I am able to do the cell formating without problem.

Thanks a lot! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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
Back
Top