I'm sure that this has been posted, or variations thereof, ad nauseam, but I could r-e-a-l-l-y use someone's help. Also, I apologise if this is a duplicate, but I'm at wits end as to how to get this thing to work.
I'm a v-e-r-y beginner programmer at VB programming and I don't have a clue as to what I'm doing. I've tried looking through some threads but can't find the basics of what I want. So, here goes....
I am trying to write a script that simply refreshes a worksheet. I don't need it to launch a rocket, but refresh a worksheet. Since I don't have a clue as to what I'm doing (I'm a beginner, remember?), I thought I'd try to piece code together that I've found on this, and other, websites.
From what I gather, my code should go into "ThisWorkbook" on the lefthandside, under "VBAProject(DOS filename goes here).
That's all that I've managed to accomplish.
Here's "my" code (actually, it belongs to some brainchild who wrote it):
Dim ThisTime As Date
Sub StartDoingIt()
DoItAgain
End Sub
Sub DoItAgain()
ThisTime = Now + TimeValue("0:00:01")
Application.OnTime ThisTime, "DoItAgain"
DoIt
End Sub
Sub DoIt()
'insert your macro here
End Sub
Sub StopDoingIt()
On Error Resume Next
Application.OnTime ThisTime, "DoItAgain", schedule:=False
End Sub
Sub Auto_Close()
StopDoingIt
End Sub
Private Sub Workbook_Open()
End Sub
All that I want to have happen is for my worksheet (called: "TESTING DATA") to be refreshed automatically. That is, I want it to refresh as though I'm sitting at my keyboard and pressing F9 all day long, but I don't want to sit here all day.
So, can someone tell me where to put the code, and how to get it to run? Also, if the above-mentioned code won't work, can someone (if you can get it to work, you will forever be known as "THE" Brainchild!), provide the proper code and provide me with the instructions as to how to get the new code to run automatically?
I would pay you, but I have legal obligations to pay my ex (=SATAN/BEELZEBUB/LUCIFER) before you. I will, however, put you on my Christmas Card list. Fair enough?
Many thanks!
I'm a v-e-r-y beginner programmer at VB programming and I don't have a clue as to what I'm doing. I've tried looking through some threads but can't find the basics of what I want. So, here goes....
I am trying to write a script that simply refreshes a worksheet. I don't need it to launch a rocket, but refresh a worksheet. Since I don't have a clue as to what I'm doing (I'm a beginner, remember?), I thought I'd try to piece code together that I've found on this, and other, websites.
From what I gather, my code should go into "ThisWorkbook" on the lefthandside, under "VBAProject(DOS filename goes here).
That's all that I've managed to accomplish.
Here's "my" code (actually, it belongs to some brainchild who wrote it):
Dim ThisTime As Date
Sub StartDoingIt()
DoItAgain
End Sub
Sub DoItAgain()
ThisTime = Now + TimeValue("0:00:01")
Application.OnTime ThisTime, "DoItAgain"
DoIt
End Sub
Sub DoIt()
'insert your macro here
End Sub
Sub StopDoingIt()
On Error Resume Next
Application.OnTime ThisTime, "DoItAgain", schedule:=False
End Sub
Sub Auto_Close()
StopDoingIt
End Sub
Private Sub Workbook_Open()
End Sub
All that I want to have happen is for my worksheet (called: "TESTING DATA") to be refreshed automatically. That is, I want it to refresh as though I'm sitting at my keyboard and pressing F9 all day long, but I don't want to sit here all day.
So, can someone tell me where to put the code, and how to get it to run? Also, if the above-mentioned code won't work, can someone (if you can get it to work, you will forever be known as "THE" Brainchild!), provide the proper code and provide me with the instructions as to how to get the new code to run automatically?
I would pay you, but I have legal obligations to pay my ex (=SATAN/BEELZEBUB/LUCIFER) before you. I will, however, put you on my Christmas Card list. Fair enough?
Many thanks!