T
twinklejmj
Hi,
I got a macro to locate the cell containing maximum value in a range
Then it goes to another cell in the same row to copy the text there an
paste it another cell. But it is not working. In debugging mode it goe
to the bold line in the code. Can someone please help??
Here is the code:
Private Sub CommandButton3_Click()
Dim i As Integer
Dim sCells As String
Dim rng As Range
Set rng = Range("L26:L38")
For i = 26 To 38
If Application.CountIf(rng, Cells(i, "L")) > 1 Then
…….
……
Call FindMax
End Sub
The macro Findmax is given below:
Sub FindMax()
Dim rng1 As Excel.Range
Set rng1 = Range("L26:L38")
*Range("L:L").Find(Excel.WorksheetFunction.Max(rng1)).Select * (Here i
stops!!)
ActiveCell.Offset(0, -10).Select
Selection.Copy
Range("B83").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Su
I got a macro to locate the cell containing maximum value in a range
Then it goes to another cell in the same row to copy the text there an
paste it another cell. But it is not working. In debugging mode it goe
to the bold line in the code. Can someone please help??
Here is the code:
Private Sub CommandButton3_Click()
Dim i As Integer
Dim sCells As String
Dim rng As Range
Set rng = Range("L26:L38")
For i = 26 To 38
If Application.CountIf(rng, Cells(i, "L")) > 1 Then
…….
……
Call FindMax
End Sub
The macro Findmax is given below:
Sub FindMax()
Dim rng1 As Excel.Range
Set rng1 = Range("L26:L38")
*Range("L:L").Find(Excel.WorksheetFunction.Max(rng1)).Select * (Here i
stops!!)
ActiveCell.Offset(0, -10).Select
Selection.Copy
Range("B83").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Su