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

daniboymu

New Member
Joined
Nov 1, 2020
Messages
39
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
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
75
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
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
 

daniboymu

New Member
Joined
Nov 1, 2020
Messages
39
Office Version
  1. 2019
Platform
  1. Windows
tomorrow I'll check if its worked, probaly it will be, so thank you very much!!
 

daniboymu

New Member
Joined
Nov 1, 2020
Messages
39
Office Version
  1. 2019
Platform
  1. Windows
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
 

daniboymu

New Member
Joined
Nov 1, 2020
Messages
39
Office Version
  1. 2019
Platform
  1. Windows
So, when I run the macro i Cant use the sheet anymore, why is this happening?
 

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
75
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,530
Messages
5,596,700
Members
414,088
Latest member
rodriboraun

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
Top