Error 1004

yummy

Board Regular
Joined
Jan 18, 2011
Messages
63
Below is my code
I get an error 1004
"Application-defined or object-defined error" on the line in red.

Sheets(1).Select
iStart = 38
'iEnd = Range("A" & iStart).End(xlDown).Row
Set f = CreateObject("scripting.dictionary")
With f
For Each h In Range("E39:E108").Value
'd.CompareMode = vbTextCompare

If Cells(iStart, "J").Value = "" Then

.Item(h) = .Item(h) + 1
iStart = iStart + 1
End If
Next h
Sheets(6).Range("K4").Resize(.count).Insert xlDown
Sheets(6).Range("J4").Resize(.count) = Application.Transpose(.Items)

Is there a way to solve this problem or is there another way of doing what I am trying to do ?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
What is this macro meant to do?

The reason why it is erroring on that line is because ".count" isn't referring to anything (eg rows.count, columns.count, etc)
 
Upvote 0
I am fairly new at writing code, but I am going to take a shot here and suggest:

Code:
Sheets(6).Range("K4").Resize(.count).Insert(xlDown)

All the times I have seen code with "xl..." it has brackets around it.

Of course, if anyone of the MVP's or senior members of the board wants to corrrect me, I am open to feedback.

Thanks,

Lidsavr
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,763
Members
452,940
Latest member
rootytrip

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