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