嗨任何人
我需要在附加格式中使用除零以外的 min 函数并突出显示该值,但我不能:(
请帮我解决我的问题。
谢谢。
我需要在附加格式中使用除零以外的 min 函数并突出显示该值,但我不能:(
请帮我解决我的问题。
谢谢。
我想根据单元格 Q12:Q18 中的最小值对 D12:AH18 范围内的所有数据进行排序,该最小值必须出现在第 1 节的行顶部,依此类推,在第 2 节到第 712 节等其他部分中也是如此No.XNUMX 并且我需要在这种排序之后,当最小数量的单元格 Q 出现在行部分的顶部时,它在背景中以黄色显示,单元格“I”中的供应商名称也显示相同的黄色背景。
Sub ExtendOffice_Sort()
Dim xExtendRg, xOfficeSRgC As Range
Dim xRg As Range
Dim xRangeAddress As String
Dim xNum, xCSNum, xCENum, xRSNum, xRSNum2, xRENum As Integer
Dim xRCount As Integer
Dim xBol, xBolWS As Boolean
Dim xStr1, xStr2 As String
Dim xWSh As Worksheet
Dim xSortColumn As Integer
On Error Resume Next
Set xExtendRg = Application.InputBox("Please select the range with data to be sorted:", "ExtendOffice - Kutools for Excel", , , , , , 8)
If xExtendRg Is Nothing Then Exit Sub
Set xOfficeSRgC = Application.InputBox("Please select the column with values to be sorted from smallest to largest:", "ExtendOffice - Kutools for Excel", , , , , , 8)
If xOfficeSRgC Is Nothing Then Exit Sub
xNum = Application.InputBox("Please enter a number of rows to be sorted in a section:", "ExtendOffice - Kutools for Excel", , , , , , 1)
Set xRg = xExtendRg
Set xWSh = xRg.Worksheet
xWSh.Activate
xSortColumn = xOfficeSRgC.Column
xRCount = xRg.Rows.Count
xCSNum = xRg.Column
xCENum = xCSNum + xRg.Columns.Count - 1
xRSNum = xRg.Row
xRENum = xRSNum + xRCount - 1
xRSNum2 = xRSNum
xRSNum = (xRSNum + xNum) - 1
xBol = True
xBolWS = Application.ScreenUpdating
Application.ScreenUpdating = False
Do While xBol
xStr1 = xWSh.Cells(xRSNum2, xCSNum).Address & ":" & xWSh.Cells(xRSNum, xCENum).Address
xStr2 = xWSh.Cells(xRSNum2, xSortColumn).Address & ":" & xWSh.Cells(xRSNum, xSortColumn).Address
'Debug.Print xStr1 & " - " & xStr2
xWSh.Sort.SortFields.Clear
xWSh.Sort.SortFields.Add Key:=Range(xStr2) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With xWSh.Sort
.SetRange Range(xStr1)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
xWSh.Sort.SortFields.Clear
If (xRSNum + xNum) >= xRENum Then
If xRSNum = xRENum Then
xBol = False
Else
xRSNum2 = xRSNum + 1
xRSNum = xRENum
End If
Else
xRSNum2 = xRSNum + 1
xRSNum = (xRSNum + xNum)
End If
Loop
Application.ScreenUpdating = xBolWS
End Sub
现在我必须在我的桌子上运行它大约 712 次并每次选择一条数据
嗨亲爱的阿曼达
坦克阅读我的请求,非常感谢您的友好回复
我有一个包含 5000 多行数据的表……
在此表中,每 7 到 11 行都有一个数字,用于合并 A 列中的单元格!
每个部分都有 1 个行号,其中包含几个供应商关于一个项目的数据,每个项目都有自己的价格,我需要的是在每个部分中将我的日期按行部分顶部任何供应商的较低价格排序😊
如您所见,我有两个请求:
1:按最低价格对我的数据的每一部分中的数据进行排序,
2:突出显示第一行的最低价格
我昨天确实解决了我的第二个请求,但我没有为我的第一个请求找到任何答案。
如果您能解决我的问题,我将不胜感激:)
不幸的是我无法上传我的桌子的图片:(