R/T 1004 - syntax error in code line

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,129
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Mobile
  3. Web
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

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
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

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
ADVERTISEMENT
You should use Formula for A1 references and FormulaR1C1 references.
 
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
You should use .Formula for A1 references and .FormulaR1C1 FOR R1C1 references?

Can you confirm!
 
Upvote 0

Forum statistics

Threads
1,195,853
Messages
6,011,969
Members
441,658
Latest member
Carlos O

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
Top