私の問題の説明に続いて: 私は列の長さを変更するテーブルを持っています。私はその後、最小値を持つ行が6列の最大値を見つけ、対応する値を選択し、値をコピーして貼り付けてください。
行にコピーする最小値の4欄に検索したいこれは私のコードです:私はエラーを取得しておくいくつかの理由
Sub TestMax()
Dim searchArea As Range
Dim searchResult As Range
Dim rowMax As Long
Dim maxValue As Long
Dim columnSearch As Integer
Dim lastRow As Long
columnSearch = 4
'Select all the cells in the column you want to search down to the first empty cell.
lastRow = Sheets("V&A 16").Range("B1048576").End(xlUp).Row
Range(Cells(8, 4), Cells(lastRow, 4)).Select
Set searchArea = Range(Cells(8, 4), Cells(lastRow, 4))
'Determine the max value in the column.
maxValue = Application.Max(searchArea)
'Find the row that contains the max value.
Set searchResult = Sheets("V&A 16").Columns(columnSearch).Find(What:=maxValue, _
After:=Sheets("V&A 16").Cells(8, columnSearch), LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)
'Store the row that contains the minimum value in a variable.
rowMax = searchResult.Cells.Row
searchResult.Select
Range(Cells(rowMax, 3), Cells(rowMax, 13)).Select
Selection.Copy
Range("C6").Select
ActiveSheet.Paste Link:=True
End Sub
。しかし、Maxの代わりにApplication.Minと全く同じコードが動作します。 Annyヘルプ?前もって感謝します!!
は、 ' – newguy