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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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,214,522
Messages
6,120,025
Members
448,939
Latest member
Leon Leenders

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