Читать книгу Excel 2019 Power Programming with VBA - Michael Alexander, Dick Kusleika - Страница 201
NOTE
ОглавлениеVBA supports yet another type of loop, While Wend
. This looping structure is included primarily for compatibility purposes. Here's how the date entry procedure looks when it's coded to use a While Wend
loop:
Sub EnterDates5() Dim TheDate As Date TheDate = DateSerial(Year(Date), Month(Date), 1) While Month(TheDate) = Month(Date) ActiveCell = TheDate TheDate = TheDate + 1 ActiveCell.Offset(1, 0).Activate Wend End Sub