|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
a18b88 发表于 2013-10-8 10:45
H列误写成N列了,更正
不会写代码,把清风幽闲老师的代码重复了一遍,日期为今天。
Sub 按钮4_单击()
lastr = Cells(Rows.Count, "a").End(3).Row - 1
't = DateSerial(Year(Date) + 1, 1, 15)
t = DateSerial(Year(Date), 10, 8)
For n = 4 To lastr
If Date = t And Cells(n, "c") <> "" Then
mystr2 = Cells(n, "d").Value
Range(Cells(n, "c"), Cells(n, "d")).ClearContents
Cells(n, "c") = mystr2
End If
Next n
For n2 = 4 To lastr
If Date = t And Cells(n2, "g") <> "" Then
mystr = Cells(n2, "h").Value
Range(Cells(n2, "g"), Cells(n2, "h")).ClearContents
Cells(n2, "g") = mystr
End If
Next n2
End Sub |
|