vba - Excel VBA在特定值后的空白单元格中添加值
解决方案
在上一个问题的答案中添加接受的代码:
Sub sub1()
Dim irow&, icol&, n&
For irow = 2 To 6 ' rows
n = 0
For icol = 2 To 14 ' columns
If Cells(irow, icol) = "" Then
n = n + 1
If n <= 3 Then
Cells(irow, icol) = "x"
ElseIf n = 4 Then
Cells(irow, icol) = "z"
End If
Else
n = 0
End If
Next
Next
End Sub
推荐阅读
- python - 按设备名称分组,然后取平均值
- react-native - 如何播放带有反应原生视频的视频并在平面列表中暂停其他视频
- r - 如何在循环R中引用列的位置
- wordpress - 如何将除主页以外的所有页面重定向到登录/注册
- ssis - SSIS执行sql语句多步骤
- java - 如果项目具有未在提供的 POJO 中定义的列,DynamoDBMapper.batchLoad 将返回什么?
- powershell - 根据文件夹名称将文件夹的内容上移一级
- java - 连接两个具有不同 AudioFormat 的 wav 文件
- javascript - 如何正确注册一个vue组件
- c# - 如何在 Blazor 服务器应用程序中验证模型而不触发验证消息?