Paresh Rawal
New Member
- Joined
- Nov 27, 2020
- Messages
- 1
- Office Version
- 365
- 2016
- Platform
- Windows
Dear All,
Please help me with the correct VBA code for the below details.
Have one data base in the excel file which refreshes every 15 minutes. But need to capture the data in different sheet on the same excel.
Below is the code i am trying but not getting the desired out put (need the data to be pasted every 15 minutes) currently its pasting everything in one go... Appreciate your help here.
Sub Refresh()
Sheets("Data").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00") - (getting error here)
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00")
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00")
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
But the current code is giving the result but not doing its job every 15 miutes.
Thank you for you help again!!!
Please help me with the correct VBA code for the below details.
Have one data base in the excel file which refreshes every 15 minutes. But need to capture the data in different sheet on the same excel.
Below is the code i am trying but not getting the desired out put (need the data to be pasted every 15 minutes) currently its pasting everything in one go... Appreciate your help here.
Sub Refresh()
Sheets("Data").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00") - (getting error here)
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00")
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Runtimer = Now + TimeValue("00.15.00")
Sheets("OI").Range("D10,J10").Copy
Sheets("Chart").Select
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
But the current code is giving the result but not doing its job every 15 miutes.
Thank you for you help again!!!