How to move the selected column left or right?

A

Andy Lenik

Hi All

I'm fairly experienced with using VBA, but new to MS Project VBA. I
find it a lot of hassle to hide a column, then select where I want it
to be and show it there... I can't believe you can't drag and drop!

I've been looking at the TableEdit method but can't seem to do what I
want (examples are a bit lacking).

I'd like to be able to create a procedure to either move the selected
column (within the selected table) left, or right. I was thinking one
sub each, that calls a central peice of code with a parameter (left /
right).

However, I can't find out which table I have selected, in order to
edit that table. I know how to hide a column, but how do I show it
again one column left / right of where it started?

Thanks very much in advance.

Andy.

P.S. I'll be adding left / right buttons on my toolbar to run the
relevant code, if anyone knows how to disable the buttons when there's
an incorrect view (or the column couldn't move in that direction) I'd
love to know how.
 
J

Jack D.

Andy said:
Hi All

I'm fairly experienced with using VBA, but new to MS Project VBA. I
find it a lot of hassle to hide a column, then select where I want it
to be and show it there... I can't believe you can't drag and drop!

I've been looking at the TableEdit method but can't seem to do what I
want (examples are a bit lacking).

I'd like to be able to create a procedure to either move the selected
column (within the selected table) left, or right. I was thinking one
sub each, that calls a central peice of code with a parameter (left /
right).

However, I can't find out which table I have selected, in order to
edit that table. I know how to hide a column, but how do I show it
again one column left / right of where it started?

Thanks very much in advance.

Andy.

P.S. I'll be adding left / right buttons on my toolbar to run the
relevant code, if anyone knows how to disable the buttons when there's
an incorrect view (or the column couldn't move in that direction) I'd
love to know how.

Why do this? Simply set up a number of standard tables and use them.
The simplest way to deal with columns is to select and hit delete, then put
the cursror where you want and hit the insert key and choose the column you
want.
I'd help with the VBA to do this, but I don't really thin that the results
are worth the effort required.

--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM


+++++++++++++++++++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top