sorry if this is already answered elsewhere, i couldn't find it.
Im trying to sort and subtotal.
I have this already:
which works fine for down, but my header is 2 rows, and in row1 there are empty cells inbetween. I was wondering how to define the selection to the right, maybe by a fixed amount of columns? since only the number of rows change. i always have only 12 columnsCode:Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select
attached file should make this easier to understand
Last edited by AndersonB; 02-02-2010 at 02:37 PM.
Never code around design errors when you can simplify your life by correcting the design.
Use 1 row for headers.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
@JBeaucaire: I dont have a choiceIs there nothing i can do?
Maybe ...
Code:range("A1", range("A2").End(xlToRight).End(xlDown)).select
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Don't have a choice? Just fix the headers:
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thank you so much shg, it worked prefectly.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks