Solved

Code To Update/Refresh Spreadsheet

Posted on 2013-01-14
5
302 Views
Last Modified: 2013-01-16
Hello Experts!

I have no idea if this is even possible.  I am hoping there is a code that I could put into my spreadsheet, that (assuming macro's are enabled) this " code " looks at range E:I, and after any cell has been entered with a value, then the spreadsheet automatically refreshes itself.

The reason, is because I have a cell in my spreadsheet that references "=NOW()" - and I need that cell to refresh with the current value. Cause there are certain cells dependant on that when values are entered into range E:I.

I hope that made sense.

Thank you in advance for your help!

~ Geekamo
0
Comment
Question by:Geekamo
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 38776804
Are you familiar with Application.OnTime?
0
 
LVL 10

Accepted Solution

by:
tdlewis earned 500 total points
ID: 38776806
I'm assuming you have automatic calculations disabled. (Otherwise, the cell containing =NOW() should update every time there is a change on the sheet.)

Add this code to the worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column >= 5 And Target.Column <= 9 Then
        Application.Calculate
    End If
End Sub

Open in new window

0
 
LVL 1

Author Comment

by:Geekamo
ID: 38776808
@ MartinLiss

I assume that's something in the code section of excel, but no.  My skill level for excel, is someone who knows their way around a 'little' more then the average user who is forced to use excel.
0
 
LVL 1

Author Comment

by:Geekamo
ID: 38776817
@ tdlewis

Uh oh.  For some reason, I had it in my head that the value =NOW() returns, it's the value from right then.  And I assumed that it wouldn't change unless something happened, making it refresh.  I just checked, and updated that range 2 minutes later, and it did update to the current time.  So there was no need to even post this question.  lol

I'm sorry for wasting your time. :)

~ Geekamo
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 38776831
What I'm suggesting is the update the time at a specific interval rather than depending on a worksheet event.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to line 23 54
Excel if formula 2 20
Turn date into age 17 32
Efficient way to copy unique records from one sheet to another 5 21
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question