Substitute error

ekslit

New Member
Joined
Apr 10, 2020
Messages
48
Hello Guys,

I m trying to get this forumla below working but i keep getting this error: Unable to get the Substitute property of the WorksheetFunction class

VBA Code:
 Range("M" & cell.Row).Value = Right(cell.Value, Len(cell.Value) - Application.WorksheetFunction.Find("@", Application.WorksheetFunction.Substitute(cell.Value, "-", "@", Len(cell.Value) - Len(Application.WorksheetFunction.Substitute(cell.Value, "-", ""))), 1))

In excel, everything working fine with this formula:

=RIGHT(D4, LEN(D4) - FIND("@", SUBSTITUTE(D4, "-", "@", LEN(D4) - LEN(SUBSTITUTE(D4, "-", ""))), 1))

Can someone help me with this please?

Thanks.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
That works for me, but you could simplify it like
VBA Code:
Range("M" & cell.Row).Value = Right(cell, Len(cell) - InStrRev(cell, "-"))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Your welcome.

Last question, i m trying to do Index / match with several criteria but the formula is not working.

VBA Code:
=INDEX(PointageStructure!$G$2:$G$1000,MATCH(1,(D2=PointageStructure!$B$2:$B$1000)*("Sub-task"=PointageStructure!$C$2:$C$1000)*("Analyste"=PointageStructure!$M$2:$M$1000),0))

Do you have any clue about the issue?

thanks again for your help.
 
Upvote 0
As that is a totally different question, it needs a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,265
Members
449,219
Latest member
daynle

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