I need this formula in excel macro "=LEFT(A1,FIND(".",A1)-1)", Please help.....
A1 is a String by name Fhead
I need this formula in excel macro "=LEFT(A1,FIND(".",A1)-1)", Please help.....
A1 is a String by name Fhead
Use InStr instead of Find.
Ben Van Johnson
Hi Ben,
I got error
Run time error 5
Invalid procure call or argument.
Please help
Please Login or Register to view this content.
Please click the * below if this helps
Use double ""."" In VBA
hope that helps
Hi - you are making a common mistake – trying to use the name of a cell in a formula while in VBA. That works in Excel formulas but not in VBA.
Try something like this instead. (I tested this with a simple SUB but it may work better for you as a FUNCTION.)
Or even better, calculate the position of the period first and check that it is not zero to avoid an error with LEFTPlease Login or Register to view this content.
Please Login or Register to view this content.
Hope this helps.
- Stu
It occurs to me that maybe you were trying to make a formula to put into a cell.
Was that your intention?
My code above does the calculation within the macro itself.
-Stu
Hello Stu,
Great code ! This works perfectly well in my situation, but what if I want to include all the A column as a range of this code instead of just A1 cell.
Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.
If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.
Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
Click the * Add Reputation button in the lower left hand corner of this post to say thanks.
Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.
Hello Stu,
Great code ! This works perfectly well in my situation, but what if I want to include all the A column as a range of this code instead of just A1 cell.
SAT007,
Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.
If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.
Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks