PDA

View Full Version : automatic moving of cells.



Tenspeed39355
11-24-2008, 11:23 AM
Good morning guys. I have a project I would like some help with.
Here goes. Lets say that I have some stock symbols in column A.
In column B I have the opening price of the stock. In column C I have the
current price of the stock and in column D I have the percent of change.
When the percent of change take place if the change is positive or negative I would like for all the columns to move up or down AUTOMATIC.
Example: If the fund SRQ changes the percent of gain up and NRO changes the percent of loss I want the two funds to change positions.
I have a program that I use to change the stock prices every few minutes so when they change I want the positions to change up or down. It would
be like an automatic sorting. Thanks for any help with this.
Max

Kenneth Hobs
11-24-2008, 02:53 PM
After you update them, would a sort not suffice?

I guess you mean that you want to move a row, not a column.

Tenspeed39355
11-25-2008, 09:34 AM
Hi Kenneth The program I use will update every all the number every 10 minutes. After the update I want to resort the all the columns by lets say column F. The whole point of this is I DO NOT WANT TO MANUALY RESORT. I want VBA to resort every time it detects a change. I have heard of a button that you can put on the ss so all you have to do is press the button.
Thanks for any help with this
Max

Kenneth Hobs
11-25-2008, 09:53 AM
You can use a button to play a macro but I thought you wanted it automated? I guess you could use a button to start the first update but an Open event for ThisWorkbook could set an OnTime event to do your updates. After the updates, it would do the sort.

Doing the sort via a macro is trivial.

If you post a short example xls, it will be easier to help.