Can You Look At this Timer Please

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
I have yet to find a timer to run this macro, can you help with this. Maybe it's the name thats wrong, I'm not sure. Thanks

Code:
Application.OnTime TimeValue("08:47:00"), "'TESTTESTTEST 2.xlsm'!Sheet2.BreakoutReDux"
Sub BreakoutReDux()
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Sheets(2)
ws.Select
TrackCol = 7 ' Use this to set the tracking column as you like.
'Set up a tracking column
Cells(2, TrackCol) = "Status"
'Determine how many rows of data we have
lastrow = Range("A32000").End(xlUp).Row
lastpostedrow = Cells(32000, TrackCol).End(xlUp).Row
'Got back to the primary-sheet2
ws.Activate
'Start looping through rows and copy to target sheet
For RowIdx = lastpostedrow + 1 To lastrow
    Range("A" & RowIdx).Select
    
    'Only copy if col A is a value > 0, else skip it
    If Range("A" & RowIdx).Value > 0 Then
        tgtsht = Asc(UCase(Range("A" & RowIdx).Value)) - 62
        tgtRow = Sheets(tgtsht).Range("A30000").End(xlUp).Row + 1
        
        Range("A" & RowIdx).Offset(0, 1).Copy 'Sheets(tgtsht).Range("A" & tgtRow)
        Sheets(tgtsht).Range("A" & tgtRow).PasteSpecial (xlPasteValues)
        
        Range("A" & RowIdx).Offset(0, 2).Copy 'Sheets(tgtsht).Range("B" & tgtRow)
        Sheets(tgtsht).Range("B" & tgtRow).PasteSpecial (xlPasteValues)
        
        Range("A" & RowIdx).Offset(0, 3).Copy 'Sheets(tgtsht).Range("C" & tgtRow)
        Sheets(tgtsht).Range("C" & tgtRow).PasteSpecial (xlPasteValues)
        
        Range("A" & RowIdx).Offset(0, 4).Copy 'Sheets(tgtsht).Range("D" & tgtRow)
        Sheets(tgtsht).Range("D" & tgtRow).PasteSpecial (xlPasteValues)
        
        Range("A" & RowIdx).Offset(0, TrackCol - 1) = "Posted"
    Else    'skip it and indicate as such
        ws.Range("A" & RowIdx).Offset(0, TrackCol - 1) = "Skipped"
    End If
Next RowIdx
'Go back to the first sheet
ws.Select
Set ws = Nothing
Application.ScreenUpdating = True
    End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Is this line sitting in a workbook that is open w/macros enabled?
Code:
Application.OnTime TimeValue("08:47:00"), "'TESTTESTTEST 2.xlsm'!Sheet2.BreakoutReDux"

It appears from the context that it resides in a different workbook than that which holds the macro...is that correct?
 
Upvote 0
It's in the same workook, same sheet as the macro. I think the name got messed up, I need to change the name maybe? Thanks
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,839
Members
452,948
Latest member
UsmanAli786

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