Hi!!
So in my sheet, I have selected column D. And I want to select the next 4 columns (including column D), so that my selection or active cells at that point would be Columns D, E, F, G and H.
All help is very appreciated! THanks!
Hi!!
So in my sheet, I have selected column D. And I want to select the next 4 columns (including column D), so that my selection or active cells at that point would be Columns D, E, F, G and H.
All help is very appreciated! THanks!
Last edited by longhorn23; 07-06-2010 at 01:08 PM.
I wouldn't recommend the "selecting" process at all, it's 99% unnecessary in VBA. You can define a range and address commands to that range directly.
But to answer your question. If you have "selected" a column and wish to resize that selection to a total of 5 columns:
![]()
Please Login or Register to view this content.
_________________
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!)
Thanks for the reply!
The way it works is that, I have a listbox which has a few values in it. The code goes into sheet1 and searches for those values and offsets or resizes to the amount of values that are stored in the listbox.
For example, if I have a 4 values in the listbox with the first value being in Column B. It should select columns B, C, D, and E. (i.e. selecting a total of 4 columns since there are 4 values).
I think your code is working though. I used the same code, but instead of resize I was using offset.
Last edited by longhorn23; 07-06-2010 at 01:17 PM.
Not sure what you mean. What type of ListBox?
You might want
![]()
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks