I have a certain excel table with merged cells, so I have to use ctrl+shift+right twice to select it completely, recording a macro yields the code for that to be a xlToright applied twice to the selection, but when I try to do the same thing with the code it doesn't work, any reason for that?
Thanks.
Edit : (Code) When I record a macro for selecting the table it gives(the table has 3 columns , each one having two merged cells)
Range("V29:W29").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
However running the same code does not select all 3 columns, only the first xlToRight works.
range("a1").CurrentRegion
? Eventually combined withIntersect()
, that solves a lot of issues. – Patrick Honorez