Excel/help in functions

Advertisement


Question
i made a simple function which displays the last time the value in a particular cell is modified. the functions works but also when just when i filter the sheet to find particular no even though i havent changed anything. it again updates when i remove the filter(updates also when i filter through other columns). how should i improve my code
Code :
Public Function Lastmodified(c As Range)

Lastmodified = Now()

End Function

Answer
Hi Salem,

I am unable to duplicate your problem. For me it only updates when the cell c changes.  When I filter columns on the sheet, add/or delete filters the time does not update.

I suggest you email your file to me so I can see what is happening and debug it.  My email is ExcelVBAconsulting@gmail.com.

Damon
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Damon Ostrander

Expertise

I have extensive experience with VBA programming in Excel 5 through Excel 2013. As a former aerospace engineer with a large aerospace corporation and consultant in a small defense technology services company, I have developed a wide range of applications in VBA, including simulations involving mixed-language programming, satellite orbit mechanics, graphics and animation, and real-time applications. I am interested in moderate to hard VBA-related questions only.

Experience

I have developed and taught several courses in Excel VBA programming and also VBA programming in Office 97, 2000, and 2007. I have developed a number of large technical applications in Excel VBA for use within the aerospace industry.

Education/Credentials
B.S. in Electrical Engineering and Computer Science, University of California, Berkeley.

©2016 About.com. All rights reserved.