PDA

View Full Version : Solved: auto changing cells



Tenspeed39355
11-07-2008, 12:45 PM
Hi Is there a way to change five column at the same time?
I need to change the five columns based on one column. The key column
is C.
I need to change the five columns every one minute.
Can this be done automatic?
Here is a sample.

Column A Column B Column C Column D Column E
NRO 10.00 15.00 5% 1
SRQ 15.00 14.00 -0.666 2
SRO 25.00 27.00 .08 3
IIA 32.00 30 -0.625 4

Bob Phillips
11-07-2008, 01:00 PM
Change to what, how?

Tenspeed39355
11-07-2008, 05:28 PM
Sorry about not putting in the changes and what for.
Lets say the Column D has percents and is the result of Column B and C.
Column B is the past price and column C is the present price. I use a program
that looks to Yahoo and when the present price changes the numbers in
column C change, this will change the percent in column D. Now for the good
part. When the precent numbers in column D change I want a sort to take
place moving the symbol with the highest percent to first place and so on.
Each time the current price changes the percent in column D changes and
that is when I want a sort to take place in column D. I want all the columns
to change at the same time just like I would highlight all the columns and then
select sort.
Max

georgiboy
11-08-2008, 10:31 AM
Something like this, it will need to go into the worksheet sheet1 module

Private Sub Worksheet_Change(ByVal Target As Range)


ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("D2:D60000"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:E60000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

End Sub

Its a bit basic i recorded it with the macro recorder :)

Hope this helps

Tenspeed39355
11-09-2008, 07:13 PM
Thanks for your help I will rate this thread
Max