1004: Application-defined or object-defined error

ARW17

Board Regular
Joined
Oct 31, 2016
Messages
109
I'm trying to create a change log for 2 different sheets in this workbook. My first one works using:


Dim irow As Long
Dim icol As Integer


For irow = 1 To 65536
For icol = 1 To 6


If Worksheets("Extra Opener Schedule").Cells(irow, icol).Value <> Worksheets("EOS").Cells(irow, icol).Value Then

Sheets("Change Log").Range("A65536").End(xlUp).Offset(1, 0) = Now()

Sheets("Change Log").Range("B65536").End(xlUp).Offset(1, 0) = Sheets("Extra Opener Schedule").Cells(1, icol) & ", " &

Sheets("Extra Opener Schedule").Cells(irow, 1).Offset(-1, 0) & " " & Sheets("Extra Opener Schedule").Cells(irow, icol).Offset(-1, 0)

Sheets("Change Log").Range("C65536").End(xlUp).Offset(1, 0) = Sheets("EOS").Cells(irow, icol)

Sheets("Change Log").Range("D65536").End(xlUp).Offset(1, 0) = Sheets("Extra Opener Schedule").Cells(irow, icol)


Exit For
Else
End If
Next icol
Next irow

But, it seems like I'm using the same philosophy on the next set and it gives me the 1004 error in the title of this post on the line:

If Worksheets("Telecommuter Schedule").Cells(xrow, xcol).Value <> Worksheets("TS").Cells(xrow, xcol).Value Then

My code for the 2nd portion is:

Dim xrow As Integer
Dim xcol As Long


For xrow = 3 To 10
For xcol = 2 To 65536


If Worksheets("Telecommuter Schedule").Cells(xrow, xcol).Value <> Worksheets("TS").Cells(xrow, xcol).Value Then

Sheets("Change Log").Range("F65536").End(xlUp).Offset(1, 0) = Now()

Sheets("Change Log").Range("G65536").End(xlUp).Offset(1, 0) = Sheets("Change Log").Range("H65536").End(xlUp).Offset(1, 0) = Sheets("TS").Cells(xrow, 1)

Sheets("Change Log").Range("H65536").End(xlUp).Offset(1, 0) = Sheets("Telecommuter Schedule").Cells(xrow, 1)


Exit For
Else
End If
Next xcol
Next xrow

:eek: Please help!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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