如果在同一行的单元格范围内发生任何更改,则Excel VBA会更新单元格中的日期(Excel VBA update the date in a cell if anything changes in a range of cells in the same row)
我有一个代码,如果在列F中同一行的单元格中进行了任何更改,则在D列单元格中更新日期:
Private Sub Worksheet_Change(ByVal Target As Range) ' Code to put the date of the latest update following a change in the corresponding cell in column F Dim WorkRng As Range Dim rng As Range Dim xOffsetColumn As Integer Set WorkRng = Intersect(Application.ActiveSheet.Range("F:F"), Target) xOffsetColumn = -2 'The date is put 2 columns to the left of column F If Not WorkRng Is Nothing Then Application.EnableEvents = False For Each rng In WorkRng If Not VBA.IsEmpty(rng.Value) Then rng.Offset(0, xOffsetColumn).Value = Now rng.Offset(0, xOffsetColumn).NumberFormat = "dd/mm/yyyy" Else rng.Offset(0, xOffsetColumn).ClearContents End If Next Application.EnableEvents = True End If End Sub
现在,我需要修改此代码,以便在列D中的单元格中更新日期,如果在列F到K中的同一行中的单元格中发生更改。
我对VBA知识很少,并且对于调整代码的任何帮助都会感激不尽。
I have a code where the date is updated in the cell in column D if any change was made in the cell in the same row in column F:
Private Sub Worksheet_Change(ByVal Target As Range) ' Code to put the date of the latest update following a change in the corresponding cell in column F Dim WorkRng As Range Dim rng As Range Dim xOffsetColumn As Integer Set WorkRng = Intersect(Application.ActiveSheet.Range("F:F"), Target) xOffsetColumn = -2 'The date is put 2 columns to the left of column F If Not WorkRng Is Nothing Then Application.EnableEvents = False For Each rng In WorkRng If Not VBA.IsEmpty(rng.Value) Then rng.Offset(0, xOffsetColumn).Value = Now rng.Offset(0, xOffsetColumn).NumberFormat = "dd/mm/yyyy" Else rng.Offset(0, xOffsetColumn).ClearContents End If Next Application.EnableEvents = True End If End Sub
Now I need to adapt this code so that the date is updated in the cell in column D if any change was made in the cells in the same row in columns F to K.
I have very little VBA knowledge and would be grateful for any help in adapting the code.
原文:https://stackoverflow.com/questions/40578527
最满意答案
不,对于非系统应用程序,/ proc / stat的所有内容都已被禁用,作为旁道。
有关更多信息,请访问Google官方回复: https : //issuetracker.google.com/issues/37140047
No, all of /proc/stat has been disabled for non-System apps, as a side-channel.
More information, with an official response from Google here: https://issuetracker.google.com/issues/37140047
相关问答
更多-
不,对于非系统应用程序,/ proc / stat的所有内容都已被禁用,作为旁道。 有关更多信息,请访问Google官方回复: https : //issuetracker.google.com/issues/37140047 No, all of /proc/stat has been disabled for non-System apps, as a side-channel. More information, with an official response from Google here: ...
-
CPU使用率无法直接测量,因为与x86不同,ARM处理器没有寄存器。 您可以使用Toolhelp API计算它以获取进程及其子线程列表,然后使用GetThreadTimes计算出每个线程使用多少时间。 请记住,执行此计算直接影响CPU的使用量。 CPU usage cannot be directly measured because, unlike an x86, the ARM processor doesn't have a register for it. You can calculate it ...
-
您需要使用top命令或ps等Linux命令: Process process = Runtime.getRuntime().exec(...); http://m2catalyst.com/tutorial-finding-cpu-usage-for-individual-android-apps 在Android中获取内存使用情况 You will need to use Linux commands like top or ps using: Process process = Runtime.get ...
-
为什么不能使用这个有助于监控内存,CPU使用率和网络活动的实时值的Android Monitor工具。 这也可以帮助我们的应用程序是否会出现内存不足问题。 这只是提高应用程序性能的好工具。 Why can't you use this Android Monitor tool which helps to monitor real time values of memory , cpu usage and network activity. This can also help whether our ap ...
-
Python和CPU使用情况(Python and CPU usage)[2023-06-30]
您的脚本在单个进程中运行,因此可以在单个处理器上运行。 Windows调度程序可能会将其从一个内核移到另一个内核,但它不能一次在多个地方运行一个进程。 如果您想要使用更多CPU的咕噜声,则需要弄清楚如何分割工作负载,以便可以在多个进程中运行代码的多个实例。 Your script is running in a single process, so runs on a single processor. The Windows scheduler will probably move it from one ... -
您可以通过查看目录 - / sys / devices / system / cpu /下的文件来检查CPU核心数。 这也适用于非root手机。 这是一个可以为您提供设备核心数量的功能 - public int getNumOfCpus() { class CPUFilter implements FileFilter { @Override public boolean accept(File pathname) { // Chec ...
-
获取当前进程的CPU使用情况(Get CPU usage of current process)[2023-09-13]
程序中有一些微不足道的错误; 我用// <<--注解了修补程序[[并且我添加了一个main()函数] #include#include #include #include #include #pragma include // <<-- non-existent header struct pstat { long unsigned int utime_tic ... -
正如问题中正确陈述的那样,不建议使用API 26 Intent.ACTION_DEVICE_STORAGE_LOW ,建议使用Context#getCacheDir()来释放应用程序缓存中的空间。 这有多个问题(下面列举),但首先:请注意,保持缓存“合理地小”(例如1 MB)是一个好习惯,我引用: getCacheDir() 返回表示应用程序临时缓存文件的内部目录的文件。 确保在不再需要时删除每个文件,并对在任何给定时间使用的内存量(例如1MB)实施合理的大小限制。 警告:如果系统存储空间不足,则可能会在没 ...
-
从文档: static long currentTimeMillis() 返回自1970年1月1日00:00:00.0 UTC以来的当前时间(以毫秒为单位)。 请用长(长)替换你正在使用的双。 虽然long(s)有精度问题,但它们几乎与所使用的变量无关,而且,舍入可能足够接近,返回值可以相互关联使用 此外,您正在比较两个独立的值。 尝试当前线程或完整线程时间。 从Debug文档: public static long threadCpuTimeNanos() 在API级别1中添加获取线程CPU使用情况的 ...
-
默认情况下,Linux上的top在所谓的IRIX模式下运行。 启用IRIX模式后,1个完全利用的核心为100%,3个核心为300%。 关闭IRIX模式后,1/8完全利用的核心为12.5%。 这意味着它在顶部显示超过300%,在“系统监视器”显示40%。 您可以在使用Shift + i运行top时切换IRIX模式。 这将使数字匹配。 By default, top on Linux runs in so-called IRIX mode. With IRIX mode on, 1 fully utilized ...