L LuisE Apr 9, 2009 #1 Application.WorksheetFunction.Left(Cells(variable , 1 ) ,9) How can i get the formula above to work? Thanks in advance.
Application.WorksheetFunction.Left(Cells(variable , 1 ) ,9) How can i get the formula above to work? Thanks in advance.
J Jacob Skaria Apr 9, 2009 #2 Since the same function is available with VBScript you can use it directly. For example. Msgbox Left("John",2) returns "Jo" If this post helps click Yes
Since the same function is available with VBScript you can use it directly. For example. Msgbox Left("John",2) returns "Jo" If this post helps click Yes
R RB Smissaert Apr 9, 2009 #3 Using the string function Left$ is faster and that may be important if it is run in a loop. Left$(Cells(variable, 1), 9) RBS
Using the string function Left$ is faster and that may be important if it is run in a loop. Left$(Cells(variable, 1), 9) RBS
R Ron Rosenfeld Apr 9, 2009 #4 Application.WorksheetFunction.Left(Cells(variable , 1 ) ,9) How can i get the formula above to work? Thanks in advance. Click to expand... You cannot as written. Left is NOT a member of the WorksheetFunction object. VBA includes Left as a built-in function. Hence there is no reason for it also to be included in the WorksheetFunction object. You can discover this by looking at the prompts that occur when you type commands in VBA; using the object browser; or using the HELP facility. Instead, try: Left(Cells(variable , 1 ) ,9) --ron
Application.WorksheetFunction.Left(Cells(variable , 1 ) ,9) How can i get the formula above to work? Thanks in advance. Click to expand... You cannot as written. Left is NOT a member of the WorksheetFunction object. VBA includes Left as a built-in function. Hence there is no reason for it also to be included in the WorksheetFunction object. You can discover this by looking at the prompts that occur when you type commands in VBA; using the object browser; or using the HELP facility. Instead, try: Left(Cells(variable , 1 ) ,9) --ron