在Excel中对彩票号码行进行排序

One of the best features of Excel is that it's quick and easy to sort columns of data

Excel的最佳功能之一是可以快速轻松地对数据列进行排序

excelsort01

You can even sort data in an Excel row, left to right, by changing one of the sort options.

您甚至可以通过更改排序选项之一,在Excel行中从左到右对数据进行排序。

excelsort16

用公式对多行数据进行排序 (Sort Multiple Rows of Data With a Formula)

In a comment on the Sort a Row in Excel 2010 blog post, Debbie asked about sorting 2000 rows, left to right. She didn't say they were lottery numbers, but her example, shown below, sure looks like that to me.

在对Excel 2010中的“排序行”博客文章的评论中,黛比询问从左至右对2000行进行排序。 她没有说他们是彩票号码,但是下面显示的她的例子对我来说确实像那样。

lotteryrowsort06

One way to sort the rows is to use a formula, in columns to the right. In the screen shot below, cells H1:M1 are selected, and this SMALL formula is entered:

对行进行排序的一种方法是使用右侧列中的公式。 在下面的屏幕快照中,选择了单元格H1:M1,并输入了这个小公式:

=SMALL(A1:F1,{1,2,3,4,5,6})

= SMALL(A1:F1,{1,2,3,4,5,6})

Then, to array-enter the formula, press Ctrl+Shift+Enter

然后,要数组输入公式,请按Ctrl + Shift + Enter

lotteryrowsort01

Then, copy the formula down to the last row of numbers, to see all the rows in ascending order.

然后,将公式复制到数字的最后一行,以按升序查看所有行。

lotteryrowsort02

As a final step, you could copy the columns of formulas, and paste them as values.

最后,您可以复制公式的列,并将其粘贴为值。

用宏对多行进行排序 (Sort Multiple Rows with a Macro)

If you don't want to mess with formulas, you could use a macro to sort each row, left to right. This macro, from Dave Peterson, will sort all the rows on the active sheet, starting in row 1, and assumes there are 6 columns of numbers.

如果您不想弄乱公式,可以使用宏从左到右对每一行进行排序。 来自戴夫·彼得森(Dave Peterson)的此宏将对活动工作表上的所有行(从第1行开始)进行排序,并假定有6列数字。

Make a copy of your original worksheet, before sorting with the macro.

在对宏进行排序之前,请复制原始工作表。

Sub SortLotteryRows()
'posted by Dave Peterson
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
With ActiveSheet
  FirstRow = 1 'change to 2 if there are headings
  LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
  For iRow = FirstRow To LastRow
    With .Cells(iRow, "A").Resize(1, 6)
      .Sort Key1:=.Columns(1), _
      Order1:=xlAscending, _
      Header:=xlNo, _
      OrderCustom:=1, _
      MatchCase:=False, _
      Orientation:=xlLeftToRight
    End With
  Next iRow
End With
End Sub

其他行排序思路 (Other Row Sorting Ideas)

Do you have any other ideas for sorting lots of rows? Please share your ideas in the comments. _____________

您还有其他想法来对很多行进行排序吗? 请在评论中分享您的想法。 ______________

翻译自: https://contexturesblog.com/archives/2011/10/28/sort-lottery-number-rows-in-excel/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值