R/T 1004 - syntax error in code line

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
Can someone assist -- This code line has Got me -- Can somone point out a missing ", or 2?
Been trying now for 20 minutes, without success.


Code:
Range("T" & nxtbr & ":T" & Currlr).Formula = "=IF(S" & nxtbr & "=""N"",""000SI"",LEFT(A" & nxtbr & ",Application.Worksheetfunction.find("","",A & nxtbr))"
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi Jim

I think it needs to end

Range("T" & nxtbr & ":T" & Currlr).Formula = "=IF(S" & nxtbr & "=""N"",""000SI"",LEFT(A" & nxtbr & ",Application.Worksheetfunction.find("","",A" & nxtbr & "))"

All the best


Dave
 
Upvote 0
Hello Jim

Why Application.WorksheetFunction.Find, not just FIND? What would your formula be if you entered it in a cell? Turning on the macro recorder and pressing F2 Enter on an existing formula will give you the syntax, albeit in R1C1 reference style.
 
Upvote 0
Andrew,
This is another AMAZING (hidden) Function of EXCEL - I didn't know one could do this,
WOW - Thanks.

Your right -- the code comes off in R1C1 syntax (which I rarely use).

My before code line began with
Range("T" & nxtbr & ":T" & Currlr).Formula =

If I paste the R1C1 code produced to the right of the above - Do I need to edit my .Formula = to .FormulaR1C1 = ?

I forgot to do that, but it seems to work without making this edit change.

Thanks again,

Jim

When I append it into my existing code do I at
 
Upvote 0
You should use .Formula for A1 references and .FormulaR1C1 FOR R1C1 references?

Can you confirm!
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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