请帮我创建一个宏/ if else语句,如果它的空白,将填充J列。
例如。
标准:
答案 0 :(得分:0)
Sub PhoneNumbers()
Dim w As Worksheet
Dim r As Range
Dim r1 As Long
Dim i As Long
Set w = Sheet1 'Replace Sheet1 with the (name) of your worksheet.
Set r = w.UsedRange
r1 = r.Row
For i = r1 To r1 + r.Rows.Count - 1
If w.Cells(i, 10).Value = "" Then
If w.Cells(i, 11).Value = "" Then
w.Cells(i, 10) = w.Cells(i, 12)
Else
w.Cells(i, 10) = w.Cells(i, 11)
End If
End If
Next i
End Sub