End of macro log

kgkev

Well-known Member
Joined
Jun 24, 2008
Messages
1,285
Office Version
  1. 365
Platform
  1. Windows
I want to create a log to record a few variables at the end of the marco.

I have done this by

Code:
    With Sheets("Progress Tracking").Range("A65000").End(xlUp).Offset(1)
            .Value = Date
            .Offset(, 1).Value = ToChase
            .Offset(, 2).Value = ToOrder
            .Offset(, 3).Value = ToChaseSoon
            .Offset(, 4).Value = totalqueries

    End With

However I do not want to record this data if it has stayed the same,

How can I compare all the variables quickly to check if anything has changed.

for example if it is the same day but the value of ToChase has change I want an new record on the log.

also if no value has changed but the date has then I also want a new value on the log.

Any suggestions welcome.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
solved it

might be a better way so still open to suggestions

Code:
    With Sheets("Progress Tracking").Range("A65000").End(xlUp).Offset(1)
        If .Offset(-1, 6).Value <> ToChase + ToOrder + ToChaseSoon + totalqueries Then
             .Value = Date
            .Offset(, 1).Value = ToChase
            .Offset(, 2).Value = ToOrder
            .Offset(, 3).Value = ToChaseSoon
            .Offset(, 4).Value = totalqueries
            With .Offset(, 6)
                .Value = ToChase + ToOrder + ToChaseSoon + totalqueries
             End With
        Else
            If .Offset(-1).Value <> Date Then
                .Value = Date
                .Offset(, 1).Value = ToChase
                .Offset(, 2).Value = ToOrder
                .Offset(, 3).Value = ToChaseSoon
                .Offset(, 4).Value = totalqueries
            End If
        End If
    End With
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,350
Members
448,956
Latest member
Adamsxl

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