View Full Version : Solved: VBA: Left & Find function Error
Hi Guys,
I'm trying to use the following function in VBA:
projman2 = left(projsect, find("","", projsect) - 1)
Everytime i run the code the "find" word is highlight with the error 'Invalid qualifier'.
Does anyone know what i'm doing wrong here
Thanks again.
F
MaximS
09-18-2008, 04:14 AM
post sample for better understanding of your problem
Bob Phillips
09-18-2008, 04:24 AM
You are trying to use Excel worksheet functions directly in VBA - oops, down she goes.
Bob Phillips
09-18-2008, 04:25 AM
Try
projman2 = left(projsect, Instr(",", projsect) - 1)
Try
projman2 = left(projsect, Instr(",", projsect) - 1)
Tried the above and i get a debug error 'Invalid Procedure call'
Example Text:
Smith, John
Result should be:
Smith
When the above code is run, during debug, the text
Instr(",", projsect) - 1
equals zero '0'.
Bob Phillips
09-18-2008, 04:45 AM
Oops, back to front
projman2 = Left(projsect, InStr(projsect, ",") - 1)
Bob,
As always....works perfectly.
thanks a lot
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.