Extract text using LEFT/FIND but with VBA

Thebatfink

Active Member
Joined
Apr 8, 2007
Messages
410
Hi,

I'm currently using the formula below to extract partial strings from cell contents for example,

Code:
=LEFT(J11,FIND("*",J11,1)-1)

I'd like to do this with VBA however. I have tried,

Code:
Application.WorksheetFunction.Left(myString, _
Application.WorksheetFunction.Find("*", myString, 1) - 1)

but it didn't like it. I presume this is possible, but what is the correct way of doing this?

Thanks!
Batfink
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,224,305
Messages
6,177,784
Members
452,805
Latest member
drew_aldana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top