Sub macros()
Dim i, cell_start, cell_end As Integer
Dim cell_x As Date
i = 1
cell_start = 4 ''' номер ячейки с начальной датой '''
cell_end = 5 ''' номер ячейки с конечной датой '''
cell_x = Cells(21, 4) ''' ячейка с контрольной датой '''
While (Cells(i, cell_start) <> "")
Rows(i).Select
If (Cells(i, cell_start) <= cell_x) And (Cells(i, cell_end) >= cell_x) Then
Selection.EntireRow.Hidden = False
Else
Selection.EntireRow.Hidden = True
End If
i = i + 1
Wend
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Dim i, col As Integer
i = 1
col = 1 ''' номер ячейки с датами '''
While (Cells(i, col) <> "")
Rows(i).Select
If Cells(i, col) <> DateClicked Then
Selection.EntireRow.Hidden = True
Else
Selection.EntireRow.Hidden = False
End If
i = i + 1
Wend
End Sub
Sub ololo()
Sheets("List").Select
Dim j As Integer
j = 1
Do Until Range("A" & j) = ""
Range("B" & j) = CDate(Range("A" & j)) + 14
Range("C" & j) = CDate(Range("A" & j)) + 21
j = j + 1
Loop
End Sub
Sub ololo()
On Error GoTo WTF
Sheets("List").Select
Dim j As Integer
j = 1
Do Until Range("A" & j) = ""
Range("B" & j) = CDate(Range("A" & j)) + 14
Range("C" & j) = CDate(Range("A" & j)) + 21
j = j + 1
Loop
MsgBox ("No errors! Success!")
GoTo StopThisShit:
WTF:
MsgBox ("ololo!!! Error there: " & Str(j))
Range("B" & j) = "ololo"
Range("C" & j) = "ololo"
Resume Next
StopThisShit:
End Sub
Sub Macros()
Dim i, j, counter As Integer
counter = 1
i = 1
While Sheets("Лист1").Cells(i, 1) <> ""
j = 2
While Sheets("Лист1").Cells(i, j) <> ""
Sheets("Лист2").Cells(counter, 1) = Sheets("Лист1").Cells(i, 1) & Sheets("Лист1").Cells(i, j)
counter = counter + 1
j = j + 1
Wend
i = i + 1
Wend
End Sub
Sub Macros()
Dim i, j, counter As Integer
counter = 1
i = 1
While Sheets("11").Cells(i, 1) <> ""
j = 2
While Sheets("11").Cells(i, j) <> "Конец"
If Sheets("11").Cells(i, j) = "" Then
j = j + 1
Else
Sheets("22").Cells(counter, 1) = Sheets("11").Cells(i, 1)
Sheets("22").Cells(counter, 2) = Sheets("11").Cells(i, j)
counter = counter + 1
j = j + 1
End If
Wend
i = i + 1
Wend
End Sub
Sub test()
Dim d As Date
d = DateAdd("d", 90, Now)
Selection.TypeText (d)
End Sub