Run-time Error 438: Object doesn't support this property or method

jwb1012

Board Regular
Joined
Oct 17, 2016
Messages
167
Hello everyone, I am getting an error on the code below (bold/underlined code) that says "Run-time Error 438: Object doesn't support this property or method"....

Any thoughts/ideas on why I am getting this error and how it can be fixed?

Code:
Sub Insert_Rows()
Dim sh As Worksheet
Dim End_Row As Long
Dim n As Long
Dim Ins As Long
For Each sh In ActiveWorkbook.Sheets
    If Left(sh.Name, 9) = "Labor BOE" Then
        
        End_Row = sh.Range("J" & Rows.Count).End(xlUp).Row
        
        Application.ScreenUpdating = False
        For n = End_Row To 3 Step -1
            Ins = sh.Cells(n, "A").Value
            
            If Ins > 0 Then
[U][I][B]                sh.Range("A" & n + 1 & ":A" & n + Ins).c.Insert[/B][/I][/U]
                sh.Range("A" & n & ":J" & n).Copy Destination:=sh.Range("A" & n + 1 & ":L" & n + Ins)
            End If
        Next n
        
    End If
Next sh
End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Shouldn't it be...

Code:
sh.Range("A" & n + 1 & ":A" & n + Ins).Insert

??? Or to insert entire rows...

Code:
sh.Range("A" & n + 1 & ":A" & n + Ins).EntireRow.Insert

???
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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