差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン | |||
| playground:playground [2025/02/06 01:20] – banana | playground:playground [2025/02/06 01:29] (現在) – banana | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== PlayGround ====== | ====== PlayGround ====== | ||
| - | < | ||
| - | Attribute VB_Name = " | ||
| - | Option Explicit | ||
| - | Private Sub ShowSchedule() | ||
| - | | ||
| - | End Sub | ||
| - | Private Sub NewWeek() | ||
| - | Dim lngCopyDetails As Long | ||
| - | | ||
| - | Const EDITABLE_GRID_ROWS = 96 | ||
| - | Const EDITABLE_GRID_COLS = 21 | ||
| - | Const EDITABLE_GRID_OFFSET_ROW = 1 | ||
| - | Const EDITABLE_GRID_OFFSET_COL = 2 | ||
| - | Const DAYS_IN_WEEK = 7 | ||
| - | Const SELECT_ROW = 2 | ||
| - | Const SELECT_COL = 4 | ||
| - | | ||
| - | On Error Resume Next | ||
| - | | ||
| - | lngCopyDetails = MsgBox(" | ||
| - | If lngCopyDetails = vbCancel Then Exit Sub | ||
| - | | ||
| - | With Application | ||
| - | .ScreenUpdating = False | ||
| - | .DisplayAlerts = False | ||
| - | ActiveSheet.Copy before: | ||
| - | With ActiveSheet.Range(" | ||
| - | .Value = .Value + DAYS_IN_WEEK | ||
| - | .Parent.Name = Format(.Value, | ||
| - | .Offset(SELECT_ROW, | ||
| - | If vbNo = lngCopyDetails Then | ||
| - | .Offset(EDITABLE_GRID_OFFSET_ROW, | ||
| - | EDITABLE_GRID_OFFSET_COL).Resize(EDITABLE_GRID_ROWS, | ||
| - | | ||
| - | End If | ||
| - | End With | ||
| - | .DisplayAlerts = True | ||
| - | .ScreenUpdating = True | ||
| - | End With | ||
| - | | ||
| - | End Sub | ||
| - | Private Sub Worksheet_Change(ByVal Target As Range) | ||
| - | |||
| - | On Error Resume Next | ||
| - | If Target.Cells.Count > 1 Then Exit Sub | ||
| - | If Not Intersect(Target, | ||
| - | [WeekStartDate].Worksheet.Name = Format([WeekStartDate], | ||
| - | End If | ||
| - | |||
| - | End Sub | ||
| - | |||
| - | Public Sub CellRoundRobin(rTarget As Range, rValidRange As Range, Cancel As Boolean) | ||
| - | |||
| - | On Error Resume Next | ||
| - | | ||
| - | If rTarget.Cells.Count > 1 Then Exit Sub | ||
| - | If Intersect(rTarget, | ||
| - | If Len(rTarget.Offset(, | ||
| - | | ||
| - | If Len(rTarget) Then | ||
| - | rTarget = vbNullString | ||
| - | Else | ||
| - | rTarget = 1 | ||
| - | End If | ||
| - | | ||
| - | Cancel = True | ||
| - | |||
| - | End Sub | ||
| - | </ | ||