Thread: help with VBA
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
indraneel indraneel is offline
external usenet poster
 
Posts: 11
Default help with VBA

yes richard that a good idea but the problem with that is that i have
the problem that looks like this


I have a set of data that i get from analyses


it is a 15 PAGE DATA that is pasted in excel


each page contains 10 SETS OF ENTRIES in 1 column say EID element id so
doing range method would be a hard going.and also i want to standardize
the method so......


the data would look like
COLUMNS:
EID A B C D E F G H I J K
123456
1 2 3 4 5 6 7 8 9 5 6
2 3 6 7 8 9 1 2 6 5 4
5 6 8 9 1 3 4 5 6 5 2
23564
1 2 3 4 5 6 7 8 9 5 6
2 3 6 7 8 9 1 2 6 5 4
5 6 8 9 1 3 4 5 6 5 2


AND SO ON


ok now what i want to do is sort by column K say(Descending) then want
the highest value to be displayed with the Element Id
so that i can move them to a new sheet where i can again sort the same
for say col K again


i was able to do it for 1 Page that is 10 values but i used the Record
Macro button but i dont see it as a good way to go and so wanted to see

how can i do it using do or if command and within it a sort command
that selects the on screen value


thank you in advance


regards
indraneel



Richard Buttrey wrote:
Something like the following will work
The first thing to do is to name the ranges you want sorted, then
build these names into the macro. In the example below, three ranges
"MyRange1", "MyRange2", "MyRange3"

then set the For..Next loop counter accordingly .


Sub SortRanges()
Dim rArray
Dim x As Integer
rArray = Array("MyRange1", "Myrange2", "Myrange3")

For x = 0 To 2
Range(rArray(x)).Sort key1:=Range(rArray(x)).Columns(1),
order1:=xlAscending
Next
End Sub



On 11 Sep 2006 10:09:54 -0700, "indraneel"
wrote:

i want to write a macro
that would contain a do loop
and within that do loop i want to do sorting

can any one help i cant understand of how to select the cells that i
want to sort in VBA language

hope i have made my self clear


regards
indraneel


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________