[FONT="]Hi[/FONT]
[FONT="]I want to use the min method of the WorksheetFunction on a range in a workbook in sheet 1, and assing the value to a variable called lastrow, like the following:[/FONT]
[FONT="]
[/FONT]
[FONT="]LowestScore = Excel.Application.Workbooks(1).Worksheets(1).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]but i get an error 438 that says that object dosen't support this property or method.[/FONT]
[FONT="]I am pretty sure that it is because that worksheet function is not at property of worksheets class.[/FONT]
[FONT="]In the object browser i can see that WorksheetFunction is a property of the application class.[/FONT]
[FONT="]My question is, how can i, in my code spcify in which sheet i want to use the worksheet function?[/FONT]
[FONT="]As above i would think it would be:[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(1).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(2).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(3).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Sincerly[/FONT]
[FONT="]Christian[/FONT]
[FONT="]I want to use the min method of the WorksheetFunction on a range in a workbook in sheet 1, and assing the value to a variable called lastrow, like the following:[/FONT]
[FONT="]
[/FONT]
[FONT="]LowestScore = Excel.Application.Workbooks(1).Worksheets(1).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]but i get an error 438 that says that object dosen't support this property or method.[/FONT]
[FONT="]I am pretty sure that it is because that worksheet function is not at property of worksheets class.[/FONT]
[FONT="]In the object browser i can see that WorksheetFunction is a property of the application class.[/FONT]
[FONT="]My question is, how can i, in my code spcify in which sheet i want to use the worksheet function?[/FONT]
[FONT="]As above i would think it would be:[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(1).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(2).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Excel.Application.Workbooks(1).Worksheets(3).WorksheetFunction.Min(Range("B1:B5"))[/FONT]
[FONT="]Sincerly[/FONT]
[FONT="]Christian[/FONT]