我有一个记录学生出勤率的Excel文件。我有一个宏合并ActiveCell.Range("A1:A50")
并在其中写“星期日”。我想要做的事情是:
到目前为止,这是我的代码:
Sub Sunday()
Dim myarr(4 To 34) As Integer
Dim col As Integer
col = ActiveCell.Column
If col = myarr Then
ActiveSheet.Cells(9).Select
'code to merge range and enter "Sunday"
Else
On Error Resume Next
End if
End Sub
答案 0 :(得分:0)
Sub Sunday()
Dim col As Long
col = ActiveCell.Column
If col >= 4 and col <=43 Then
ActiveSheet.Cells(9, col).Select
'code to merge range and enter "Sunday"
Else
End if
End Sub