本文介绍了需要帮助排序宏。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作表,我运行了一个宏列表,以及一个由工作表编辑的名为Orders.xls的工作表。它有4列,最多3000行。我记录了一个宏,按产品编号按D列对发票进行排序。此宏不会出错,但不会对任何数据进行排序。以下是我所尝试的宏的一个例子。

需要排序的数据:


产品详情产品产品

代码号码号码

----- ----- ----- -----

PHT PHOTOS 129 8

PRN PRINTER 1 139

PHN PHONE 3 23

排序结果


产品样品产品

代码号码号码

----- ----- ----- - ---

PHT PHOTOS 129 8

PHN PHONE 3 23

PRN PRINTER 1 139

=codeHolderclass =codeHolder>

展开 | 选择 | Wrap | 行号

解决方案





通常,最简单的方法是获取正确的参数(或者至少得到一些关于如何处理它们的想法)是记录一个宏,并采取行动(在这种情况下,你自己。然后宏将包含你想要的代码。


我自己试过这个,我看到你的Key看起来很好(抱歉)。但是,只是为了看看它是否有任何区别,你能试试这个修改过的版本吗? (我现在假设你已经在ORDERS表中)

展开 | 选择 | Wrap | 行号


I have a worksheet that I run a list of macros from, and a sheet called Orders.xls that is edited by the worksheet. It has 4 columns, and a maximum of 3000 rows. I recorded a macro to sort the invoices by column D, by product number. This macro does not error, but does not sort any data. An example of what it sorts is below, also with the macro I am trying.

Data needing sorted:

PRODUCTPRODUCTPRODUCTPRODUCT
CODENAMECOUNTNUMBER
----- ----- ----- -----
PHTPHOTOS1298
PRNPRINTER1139
PHNPHONE323

Result of sort:

PRODUCTPRODUCTPRODUCTPRODUCT
CODENAMECOUNTNUMBER
----- ----- ----- -----
PHTPHOTOS1298
PHNPHONE323
PRNPRINTER1139

Expand|Select|Wrap|Line Numbers

解决方案



Usually the easiest way to get the parameters right (or at least get some ideas on what to do with them) is to record a macro, and do the action (in this case the sort) yourself. Then the macro will contain the code to do what you want.

Having just tried this myself, I see that your Key seems fine (sorry about that). However, just to see whether it makes any difference, could you try this modified version? (I''m assuming for the moment that you''re already in the ORDERS sheet)

Expand|Select|Wrap|Line Numbers


这篇关于需要帮助排序宏。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 12:33