Select the range of cells which contain Merged cell in between

shockmoorthy

New Member
Joined
Jun 3, 2019
Messages
5
Hai Dudes,
I would like to select the range of cells in one row which contains some merged cells in between. The macro has to be run for many files with different range of cells. For example File1 has to be select from C5:C10, file2 has to select from C5:C20. There are some cells merged in the selection range for example in file1 C6,C7 and C8,C9 merged, in file2 C5,C6 and C9,C10 merged. I have tried two option. I record the macro while working but when I run through the macro, it doesn't works. Can some one help on this.
Range("C5").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlUp)).Select
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the Forum!

What do you need to select the merged cells for?
Do you want to select all the merged cells in column C?
You can upload an image to see how you have the cells.

You could upload a image file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Dear Amor, As I am working with office system I couldn't upload the Image. I need to select cells which have values in Column "C" and do Justify format and make Thick outer Boarders. While working manually I can select my mouse or crl+shift+down arrow key up-to end and go up which will stop in the last row of value cell. I have recorded the macro while working and tried but didn't works even with the recorded file. I need to run this macro for many files where there are different range of cells to be select so couldn't give common ranges while writing macro.
 
Upvote 0
Dear Amor, As I am working with office system I couldn't upload the Image. I need to select cells which have values in Column "C" and do Justify format and make Thick outer Boarders. While working manually I can select my mouse or crl+shift+down arrow key up-to end and go up which will stop in the last row of value cell. I have recorded the macro while working and tried but didn't works even with the recorded file. I need to run this macro for many files where there are different range of cells to be select so couldn't give common ranges while writing macro.


Well, you did not answer any of my questions, so I'm still in the same place.
You can at least try to explain graphically how your cells are and which ones you want to select.
 
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,653
Members
449,462
Latest member
Chislobog

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