Userform sorting data

S

Sue

Hi Experts

Small problem for you for me its difficult -- the command button - code below
Private Sub Add1_Click()
Tb99.Value = ActiveSheet.Range("B26")
Tb100.Value = ActiveSheet.Range("C26")
Tb101.Value = ActiveSheet.Range("D26")
Tb102.Value = Format(ActiveSheet.Range("E26"), "0.000")
Tb103.Value = ActiveSheet.Range("B27")
Tb104.Value = ActiveSheet.Range("C27")
Tb105.Value = ActiveSheet.Range("D27")
Tb106.Value = Format(ActiveSheet.Range("E27"), "0.000")
End Sub

the Activesheet info starts at row5 - ends at row 30 -- columns B thru E
what would I need to add to above code where in col E I need to find the
highest number and the insert the whole row B thru E into Row 26 then find
the second highest number and insert that row into B27 -- the final criteria
being that before the highest and second highest number are chosen they must
have the number 14 in row F - therefore if the highest number had 13 or less
in col F it would be ignored the same applying to the second highest number.
 
M

Michael

Finding the first 2 numbers is not difficult you can either use a combination
of MAX and LARGE functions or two iterations of LARGE, but your final
criteria is really hard to understand. Before choosing the 2 numbers,
"theymust have the number 14 in row F"?
F is not a row is a column.
Should the number have a 14 prefix or somewhere in between?
I think you should copy and paste a sample of the data, to get you a
complete answer.

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.
 
M

Michael

Please post a sample of your data.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.
 

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