Find cells containing @

drgstr

New Member
Joined
Nov 12, 2008
Messages
18
i am running a macro, i need it to fill entire column (G) with the formula.
if it finds an @ then it needs to return a value (B).

LastRow = Range("B" & Rows.count).End(xlUp).Row
Range("G1:G" & LastRow).Formula = "=IF(OR(ISNUMBER(FIND({"@"},B2))),B2,"")"

I keep getting syntax error.
it doesnt seem to like the @ symbol.

any ideas would be appreciated.
thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
You do not have your quotes correctly set up, try this:

Range("G1:G" & LastRow).Formula = "=IF(OR(ISNUMBER(FIND({""@""},B2))),B2,"""")"

Also I don't think you need the curly brackets OR the or statement for this exact formula, so this would probably work also:

Range("G1:G" & LastRow).Formula = "=IF(ISNUMBER(FIND(""@"",B2)),B2,"""")"

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,034
Members
448,940
Latest member
mdusw

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