Hi all,
A small problem; I am using a Worksheetfunction.Max command to find the maximum value from more than one number on a spreadsheet, this maximum number is then stored in a string variable, for example
sMax = Worksheetfunction.Max(x1, y1)
x1 and y are also string variables.
The problem occurs when one of the searched numbers cannot be found, or does not exist, on the spreadsheet. In this instance I state that the representative variable, x1 or y1, is "-". This is so that when both cannot be found, "-" is shown on the populated spreadsheet.
When running the script with a "-" stored in one of the variables, a run-time error 1004 occurs on the worksheet function, 'Unable to get the Max property of the WorksheetFunction class.'
Is there a way around this without having to add if functions?
Thanks in advance.
Bookmarks