Why am I getting an "Object required" Here?

Shafty

New Member
Joined
Mar 20, 2017
Messages
43
Why am I getting the following Error Message on the Below codes.

Run-time error '424':
"Object required"

Code:
Public Sub NewIT()
Dim Employees As ListObject
    Set Employees = ThisWorkbook.Sheets("Employees").ListObjects("Employees")
    Call ThisWorkbook.Worksheets.Add(After:=Employees.Parent, Count:=Employees.ListRows.Count)
Dim Individuals As Worksheets
    Set Individuals = Array(ThisWorkbook.Worksheets.Add(After:=Employees.Parent, Count:=Employees.ListRows.Count))
    Call Individuals.FillAcrossSheets(Employees.HeaderRowRange, xlFillWithAll)
End Sub

Requesting our dear members to Kindly rectify this issue. Thank You.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I am not sure why you are trying to use "Call" here. That is typically used to call other Procedures.
See: https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/call-statement

The Same error occurs even after removing the "Call" Keyword. I am requesting all our members to kindly provide an insight on why this error is coming and How to resolve it. Thanks in Advance. Work at stake :(

Code:
Public Sub NewIT()Dim Employees As ListObject
    Set Employees = ThisWorkbook.Sheets("Employees").ListObjects("Employees")
     ThisWorkbook.Worksheets.Add After:=Employees.Parent, Count:=Employees.ListRows.Count
Dim Individuals As Worksheets
    Set Individuals = Array(ThisWorkbook.Worksheets.Add(After:=Employees.Parent, Count:=Employees.ListRows.Count))
    Individuals.FillAcrossSheets Employees.HeaderRowRange, xlFillWithAll
End Sub
 
Last edited:
Upvote 0
Which line do you get the error on?
And what are you trying to do here
Code:
Set Individuals = Array(ThisWorkbook.Worksheets.Add(After:=Employees.Parent, Count:=Employees.ListRows.Count))
 
Upvote 0
Hi Fluff. I have to say a lot. Need some more time to type it. Requesting you to kindly keep your interest on this post. Thank you.
 
Upvote 0
It looks to me like you're trying to add a new sheet and copy existing data into that new sheet ???
 
Upvote 0

Forum statistics

Threads
1,215,267
Messages
6,123,964
Members
449,137
Latest member
yeti1016

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