Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help wanted with VBA code

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

thanking you in advance


regards
indraneel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Help wanted with VBA code

You need to give more information if you want to get explicit help on which
columns you want to sort on and whether you have a header row of field names.
I don't think you need to find the range unless you only want to sort on a
range instead of the whole sheet. Here is an example of my sort on 3 columns
with the 3 labels in the first row as the matching key.

Sub Sort()


Set rng = .Range(.Cells(1, 1), .Cells(Rows.Count, 26).End(xlUp))
MsgBox rng.Address
rng.Sort key1:=.Cells(1, 16), Order1:=xlAscending, _
key2:=.Cells(1, 19), Order2:=xlAscending, _
key3:=.Cells(1, 3), Order3:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False, Orientation:=xlTopToBottom
End With


End Sub


" 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

thanking you in advance


regards
indraneel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Help wanted with VBA code

You haven't!

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
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

thanking you in advance


regards
indraneel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help wanted with VBA code

the problem that i have infront of me is something 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 entries in 1 column say EID element id

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


@ BOB YOU HAVENT = ??????
Bob Phillips wrote:
You haven't!

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
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

thanking you in advance


regards
indraneel


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help wanted with VBA code

hi


i was able to solve the hard part that is getting to sort now i want to
link sheet two values with sheet one and again sort can anyone help me
eith the linking



thanks in advance


indraneel
wrote:
the problem that i have infront of me is something 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 entries in 1 column say EID element id

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


@ BOB YOU HAVENT = ??????
Bob Phillips wrote:
You haven't!

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
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

thanking you in advance


regards
indraneel


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Wanted Shiblie Bshara Excel Worksheet Functions 1 May 1st 08 01:05 PM
VBA Code wanted for Excel lost in Chicago[_2_] Excel Discussion (Misc queries) 5 March 4th 08 04:37 AM
Editable combo. Elaborate code example wanted. keepITcool Excel Programming 0 October 10th 05 01:01 PM
vba code wanted helmekki[_2_] Excel Programming 2 May 12th 04 11:05 PM
urgent vba code wanted helmekki Excel Programming 2 May 12th 04 12:38 PM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"