我有一个Excel页面,并且存储日期类型数据。这将记录每年的额外工作日和假期。此页面中的其他表具有开始和结束日期。我想给员工一些间隔时间。我想使用VBA。如何解决这个问题?
答案 0 :(得分:1)
答案 1 :(得分:-1)
这是Excel表和我的代码的图片:
Dim startDate As Date
Dim endDate As Date
Dim retValue As Integer
Dim days As Variant
Dim dates As Variant
days = Worksheets("Tényleges munkanapok").ListObjects("TáblázatKorrekciósNapok").DataBodyRange.Value
dates = Worksheets("Tényleges munkanapok").ListObjects("TáblázatSzámoló").DataBodyRange.Value
Dim i As Integer
Dim actualDate As Date
startDate = days(1, 1)
actualDate = dates(1, 1)
Dim CountVariant As Integer
CountVariant = UBound(days)
i = 0
Do While i <= CountVariant
If startDate < actualDate Then
i = i + 1
End If
Loop