大家好
我需要在附加格式中使用除零之外的 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:突出顯示第一行的最低價格
我昨天確實解決了我的第二個請求,但我沒有找到第一個請求的任何答案。
如果您能解決我的問題,我將不勝感激:)
不幸的是我無法上傳我的桌子的圖片:(