如何在C中的某个时间后停止while循环,我在c ++中完成它并且我尝试将其转换为c(下面)但它没有工作
#include <time.h>
int main(void)
{
time_t endwait;
time_t start;
endwait = start + seconds ;
while (start < endwait)
{
/* Do stuff while waiting */
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个擅长的地方
如果现有填充颜色为黄色,则删除单元格填充颜色
仅当现有字体颜色为红色时,才将单元格文本颜色设置回黑色。
我编写了一个宏,该宏只是在每个单元格上循环并检查字体颜色/填充颜色
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
...
For Each Cell In ws.UsedRange.Cells
If Cell.Font.ColorIndex = 3 Then
Cell.Font.ColorIndex = 0
End If
If Cell.Interior.ColorIndex = 6 Then
Cell.Interior.Pattern = xlNone
Cell.Interior.TintAndShade = 0
Cell.Interior.PatternTintAndShade = 0
End If
Next
Run Code Online (Sandbox Code Playgroud)
它可以按预期工作,但运行速度很慢,可能是因为它经过每个单元。是否有使这项工作更快的方法?我尝试将条件格式与VBA一起使用,但似乎无法检查单元格颜色/单元格字体颜色...