VBA Excel FormulaR1C1 Application Defined or Object Defined Error

0 votes

Use a recorded macro to define the correct formulas before attempting to update them in accordance with each "0" line to calculate subs and maximum values. If you do this, a definition error will occur. FormulaR1C1 couldn't be written correctly, which is the issue. use excel 2019 pro plus. Please assist me.

Here's the code :

Sub hesapla()
Dim zero_ındex As Integer
Dim lnn As Integer
Dim row As Integer
Dim a As Integer
Dim b As Integer
Dim Rng As Range
a = 2
b = 0
Sheet3.Activate
rown = Sheet3.Cells(Rows.Count, 1).End(xlUp).row


For a = 2 To rown

Do While Sheet3.Cells(a, 1).Value <> ""

If Sheet3.Cells(a, 1).Value = "0" Then
zero_ındex = a
b = a
b = b + 1


    Do While Sheet3.Cells(b, 1).Value <> "0"
    b = b + 1
    
        
    Loop
lnn = b - 1

Sheet3.Range("U" & a).Select
 Selection.FormulaR1C1 = "=SUMPRODUCT(MAX(((RC[-3]:R[ " & lnn & " ]C[-3]=""B"")+(RC[-3]:R[ " & lnn & " ]C[-3]=""Y""))*(RC[-2]:R[ " & lnn & " C[-2])))"

End If
a = a + 1
Loop
Next a
End Sub---
Mar 20, 2023 in Others by Kithuzzz
• 38,000 points
431 views

1 answer to this question.

0 votes
Consider using a fixed template for the formula and Replace() to fill in the values.

I hope this helps you.
answered Mar 20, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

Runtime error 438 while importing data in excel from secured website using VBA

Replace With ieDoc.forms(0) .userType.Value = "1" ...READ MORE

answered Sep 23, 2022 in Others by narikkadan
• 63,600 points
889 views
0 votes
1 answer
0 votes
0 answers

Converting feet & inches (e.g., "5 ft 1 in") to decimal feet using VBA or Excel

I have a database with a few ...READ MORE

Nov 2, 2022 in Others by Kithuzzz
• 38,000 points
585 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,211 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,662 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
906 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,053 views
0 votes
1 answer

VBA: My Email .body doesn't concatenate with itself: application-defined or object-defined error

Try this: 'Somewehere declare this string variable Dim incomingHTMLBody ...READ MORE

answered Feb 16, 2023 in Others by narikkadan
• 63,600 points
879 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP