could someone please add a code for me, i am new at excel

daniboymu

Board Regular
Joined
Nov 1, 2020
Messages
54
Office Version
  1. 2019
Platform
  1. Windows
Hi Guys, I need some help, could someone please add a code which makes this macro runs every 15 minutes also if possible makes the macro runs only between 9:15 am to 6:15 pm the second ask its only if possible. thanks anyway!!
THE CODE:
VBA Code:
Sub Atualizar()

    Rows(7).Insert
   Range("A8:DG8").Value = Range("A5:DG5").Value
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You could do something like this.

VBA Code:
Sub Atualizar()

    Do
        If Time < TimeValue("09:15:00") Or Time >= TimeValue("18:15:00") Then End
        Rows(7).Insert
        Range("A8:DG8").Value = Range("A5:DG5").Value
        Application.Wait (Now + TimeValue("0:15:00"))
    Loop
    
End Sub
 
Upvote 0
tomorrow I'll check if its worked, probaly it will be, so thank you very much!!
 
Upvote 0
You could do something like this.

VBA Code:
Sub Atualizar()

    Do
        If Time < TimeValue("09:15:00") Or Time >= TimeValue("18:15:00") Then End
        Rows(7).Insert
        Range("A8:DG8").Value = Range("A5:DG5").Value
        Application.Wait (Now + TimeValue("0:15:00"))
    Loop
   
End Sub
i tried here buy my excel just stop working
 
Upvote 0
So, when I run the macro i Cant use the sheet anymore, why is this happening?
 
Upvote 0
That works by running a macro on a continuous loop and waiting 15 minutes at the end of each loop. There isn't really an easy way to initiate a macro to run every 15 minutes. You might be able to set something up in Windows task scheduler, however you would probably be better off looking for a different way of doing your process in my opinion.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

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