vivek pare
New Member
>>> as written many times <<<
>>> use code - tags <<<
after running the code i got value "0" in kcc excel sheet column no 9
Can any one solve i have attached kcc and statmt file also
vivek
>>> use code - tags <<<
Code:
dim xmax as variant
Set wks2 = Sheets("STATMT")
lastLine = wks1.UsedRange.Rows.Count
XLST = wks2.UsedRange.Rows.Count
For I = 2 To lastLine
Set wks1 = Sheets("KCC")
acno = wks1.Cells(I, 1).Value
Set wks2 = Sheets("STATMT")
wks1.Activate
acno = wks1.Cells(I, 1).Value
wks2.Activate
'wks2.Range
rngVal = Sheets("STATMT").Range("c2:c" & XLST).Address
rngName = Sheets("STATMT").Range("a2:a" & XLST).Address
'Worksheet function MAX returns the largest value in a range
xmax = Evaluate("MAX(IF(" & rngName & "=" & Trim(acno) & "," & rngVal & "))")
wks1.Cells(I, 9).Value = xmax
Next I
End Sub
Can any one solve i have attached kcc and statmt file also
vivek
Attachments
Last edited by a moderator: