Code line syntax error

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
Syntax error on Line 2 - Help!


Rich (BB code):
MyCnt = WorksheetFunction.CountA(Range(Cells(i, "E"), Cells(i, "T")))
    Cells(i, "A").Offset(1).Rows(""1:" & MyCnt & "")" & .EntireRow.Insert
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try

Code:
MyCnt = WorksheetFunction.CountA(Range(Cells(i, "E"), Cells(i, "T")))
    Cells(i, "A").Offset(1).Rows("1:" & MyCnt).EntireRow.Insert
 
Upvote 0
Suddenly got another 1004 R/T from: Can anyone spot problem?

Code:
Range("V2:V" & LR).Formula = "=IF(ISNA(INDEX($E2:$T2,1,MATCH($D2,$E$1:$T$1,0))>0),""NONE REV DEPT"",IF(INDEX($E2:$T2,1,MATCH($D2,$E$1:$T$1,0))>0,""DUP TRANS"",""))"
 
Upvote 0
You forgot to double up the final quotes:
Rich (BB code):
Range("V2:V" & LR).Formula = _
"=IF(ISNA(INDEX($E2:$T2,1,MATCH($D2,$E$1:$T$1,0))>0),""NONE REV DEPT"",IF(INDEX($E2:$T2,1,MATCH($D2,$E$1:$T$1,0))>0,""DUP TRANS"",""""))"
 
Upvote 0
Rory, THANKS !!!

I guess 2 out of 3 times is not "ENOUGH"; LOL, Thanks ! Been at this ALL DAY,,, Jim
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

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