AlaskanVBA
New Member
- Joined
- Mar 27, 2011
- Messages
- 6
I'm receiving a 'RunTime Error 424 : Object Required" on the following line:
F = Application.WorksheetFunction.CountIf(R4C9.Resize(FinalRow9, 0), RiC1)
Any advice would be greatly appreciated?
Below is the full code
----
Sub SecondaryC()
Dim WSPC As Worksheet
Dim WSSI As Worksheet
Set WSPC = Worksheets("PrimaryCreation")
Set WSSI = Worksheets("SecondaryInput")
FinalRowC123 = WSSI.Cells(Rows.Count, 1).End(xlUp).Row
FinalRowC9O = WSSI.Cells(Rows.Count, 9).End(xlUp).Row
FinalRowC9F = WSSI.Cells(Rows.Count, 9).End(xlUp).Row
'testing new code
For i = 4 To FinalRowC123
Sec = WSSI.Cells(i, 3)
FinalRowC123 = WSSI.Cells(Rows.Count, 3).End(xlUp).Row
Cells(i, 1).Resize(1, 7).Select
'Find out if From and To inputs are primary or secondary joints'
'Error on next code line?
F = Application.WorksheetFunction.CountIf(R4C9.Resize(5, 0), RiC1)
---------
F = Application.WorksheetFunction.CountIf(R4C9.Resize(FinalRow9, 0), RiC1)
Any advice would be greatly appreciated?
Below is the full code
----
Sub SecondaryC()
Dim WSPC As Worksheet
Dim WSSI As Worksheet
Set WSPC = Worksheets("PrimaryCreation")
Set WSSI = Worksheets("SecondaryInput")
FinalRowC123 = WSSI.Cells(Rows.Count, 1).End(xlUp).Row
FinalRowC9O = WSSI.Cells(Rows.Count, 9).End(xlUp).Row
FinalRowC9F = WSSI.Cells(Rows.Count, 9).End(xlUp).Row
'testing new code
For i = 4 To FinalRowC123
Sec = WSSI.Cells(i, 3)
FinalRowC123 = WSSI.Cells(Rows.Count, 3).End(xlUp).Row
Cells(i, 1).Resize(1, 7).Select
'Find out if From and To inputs are primary or secondary joints'
'Error on next code line?
F = Application.WorksheetFunction.CountIf(R4C9.Resize(5, 0), RiC1)
---------