View Full Version : VBA highlighting cells and merging


meadt
03-25-2010, 08:10 AM
Hi Guys,

I need some code that will merge a cell and the one next to it. Problem is this cell could be anywhere and uses code to find its location so it will never be in a difinitive location. Any suggestions?

Cheers,

T.

chergh
03-25-2010, 09:27 AM
Don't use merged cells. Now if you tell us what you are trying to achieve we can help more.

meadt
03-26-2010, 12:01 AM
Hi Chergh,

Thanks for replying. Basically I have a large amount of data in a spreadsheet that needs to be filtered. One of the filtering steps is to go down a date column and when the program finds a predefined date, it will add a new row above it. I then need to add some text into this row as a title. I want to be able to merge these cells so that the text displays properly. This row however will never be in the same place so I cant hard code it.

Cheers,

T.

chergh
03-26-2010, 12:54 AM
This will be easier if you post the code you have to find your match as there are several ways you can use to find a match, and how you find your cells will determine how you format the cells. You don't need to merge the cells instead you can format the cells so it looks like they are merged.