Календарь vba excel макрос

Андрей Александрович

Андрей Александрович

8 месяцев назад

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Андрей Александрович

Здравствуйте, ответ отправил Вам на электронную почту

Владимир


Ответить на 

Admin

Здравствуйте, отправьте мне тоже пожалуйста на что нужно поменять для ввода даты в отдельную ячейку

Сергей

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Сергей

Здравствуйте, ответил вам на электронную почту

Nursultan

Nursultan

6 месяцев назад

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Nursultan

Здравствуйте, ответил вам на электронную почту

Алексей Коржов

Здравствуйте. Скачал календарь и тот же вопрос как применить календарь к любой выделеной ячейке.

Admin

Автор


Ответить на 

Алексей Коржов

Здравствуйте, ответил вам на электронную почту

Игорь

Добрый день. Не могли бы и мне отправить макрос с возможностью вставки календаря в любую выделенную ячейку. Спасибо

Admin

Автор


Ответить на 

Игорь

Здравствуйте, ответил вам на электронную почту

Сергей

Здравствуйте! Подскажите пожалуйста, что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Сергей

Здравствуйте, ответ отправил вам на электронную почту

Николай

Добрый день, аналогичный вопрос. Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?

Admin

Автор


Ответить на 

Николай

Здравствуйте, ответ отправил вам на электронную почту

Вера

Добрый день. Очень необходимая вещь! Что изменить в макросе, что бы можно было вставлять дату в любую ячейку определенного столбца?

Admin

Автор


Ответить на 

Вера

Здравствуйте, ответ отправил вам на электронную почту

Марина

Здравствуйте. Спасибо за доступное видео! Что изменить в макросе, что бы можно было вставлять дату в несколько ячеек?

Сергей

Здравствуйте. Мне как и всем:) подскажите пожалуйста как изменить макрос для вставки в любую выделенную ячейку

Дмитрий

Не хочется повторяться, но – “Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!” Спасибо)

Марина

Добрый день! Как изменить макрос на работу в диапазоне, а не в одной ячейке

Admin

Автор


Ответить на 

Марина

Здравствуйте, ответил вам на электронную почту

Александр

Александр

3 месяцев назад

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Азамат

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Михаил

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Михаил

Ответил на электронную почту

Артур E

Добрый день. Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?

Admin

Автор


Ответить на 

Артур E

Здравствуйте, ответ отправил вам на электронную почту

дмитрий

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Евгения

Замечательно!
но можно подсказать, что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку столбца
Заранее спасибо!

Admin

Автор


Ответить на 

Евгения

Здравствуйте, ответил на электронную почту

Владимир

но можно подсказать, что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку столбца
Заранее спасибо!

Admin

Автор


Ответить на 

Владимир

Здравствуйте, ответ отправил вам на электронную почту

Виталий

Здравствуйте ! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Виталий

Здравствуйте, ответ отправил вам на электронную почту

Роман Докучаев

Аналогичный вопрос по календарю, чтобы работал в любой ячейке

Роман Докучаев

Аналогичный вопрос. Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку! Заранее спасибо за ответ

Admin

Автор


Ответить на 

Роман Докучаев

Здравствуйте, ответ отправил вам на электронную почту

Эльвина

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?!

Admin

Автор


Ответить на 

Эльвина

Здравствуйте, ответ отправил вам на электронную почту

Екатерина

Екатерина

2 месяцев назад

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку???

Admin

Автор


Ответить на 

Екатерина

Здравствуйте, ответ отправил вам на электронную почту

Павел

Здравствуйте! Подскажите можно ли при помощи подобного макроса сделать не только вставку даты но и подсчет дней. То есть есть три столбца в первом дата начала работы, во втором дата окончания работы, а в третьем количество дней потраченных на выполнение работы. Заранее спасибо!

Admin

Автор


Ответить на 

Павел

Здравствуйте, можно сделать следующим образом:
при помощи формы вставлять дату в первые два столбца, а в третьем столбце при помощи формулы будет расчитываться количество дней.

Ирина

Добрый день. Подскажите, пожалуйста, что изменить в макросе, что бы можно было вставлять дату в несколько ячеек одновременно на одном листе?

Андрей Ермак

Доброго времени! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Admin

Автор


Ответить на 

Андрей Ермак

Здравствуйте, ответ отправил вам на электронную почту

Вадим

Доброго времени! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Михаил

Добрый день. Спасибо за урок. Просто и быстро. Подскажите, что нужно изменить в макросе, что бы можно вставлять дату в любую выделенную ячейку. Если возможно, подскажите макрос как у Вас на видео (6 мин.). Большое спасибо.

Admin

Автор


Ответить на 

Михаил

Здравствуйте, ответил вам на электронную почту.

гога

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку! спасибо зарании

Дмитрий

Доброго времени! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Михаил

Добрый день. Спасибо за ваш календарь.
Мне тоже нужна информация как вставлять дату в выделенную ячейку.

Admin

Автор


Ответить на 

Михаил

Здравствуйте, ответ отправил вам на электронную почту.

Виктория

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Aleksandr Kornienko

Добрый день! Мне тоже очень нужна эта же информация – как вставлять дату в любую выбранную ячейку. За ранее благодарю!

Александр

Добрый вечер , хотел бы тоже знать , что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?

Влад

Здравствуйте! Буду благодарен, если не затруднит, если поделитесь нюансом в макросе, который позволил бы, вставить дату в выделенную ячейку. Заранее спасибо!

Роман

Добрый день. Подскажите, как вставлять дату в выделенную ячейку. И еще вопрос, можете подсказать,что изменить в макросе, чтоб вставлялась не дата, а номер недели. Планер на год делаю себе.
Спасибо.

Игорь

Доброго времени суток! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?
Заранее спасибо)

Последний раз редактировалось 22 дней назад Игорь ем

Владислав Николаев

Здраствуйте, а как сделать так, чтобы для других ячеек на листе тоже открывался календарь? спасибо за помощь

gutumo

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Оксана

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку?
Заранее спасибо!

Виктор

Добрый день! Что изменить в макросе, что бы можно было вставлять дату в любую выделенную ячейку!

Николай

Здравствуйте. Я не буду оригинален и у меня тот-же вопрос.Что надо изменить в макросе чтоб дата вставлялась в активную ячейку? Спасибо.

Антон Антонов

Здравствуйте. Мучает такой же вопрос как и всех.Что надо изменить в макросе чтоб дата вставлялась в активную ячейку? Спасибо

Admin

Автор


Ответить на 

Антон Антонов

Здравствуйте, ответ отправил на электронную почту

Date Picker Calendar in Excel VBA

Oftentimes, users want to click a button and select a date. This is no different for Excel developers. Check out this ActiveX control by Microsoft that allows users to do just that. It’s a little old school looking, but actually has quite a nice feel to it.

Start by creating a userform and enabling the control by Right-clicking on the Tools menu and click Add additional tools

Now, let’s add this to the userform!

Calendar In Excel using Microsoft MonthView Control

In the downloadable workbook, you’ll see the control was renamed to ‘fCal’. When you double-click the control you’ll see the following code which is the DateClick event of that control:

code snippet

This userform cleverly has two labels to store relevant info on the Userform that summoned it. 1.) The name of the userform that called it and 2.) The name of the control or textbox that needs the date sent to it.

Then, this code above loops through all userforms in your project until it finds one that matches the label for the Userform (lblUF) and the label for the textbox needed (lblCtrlName).

Also, you may need to enable Microsoft Windows Common Controls -2 6.0 (SP6) by using Tools->References and clicking:

s

Stop Wasting Your Time

Experience Ultimate Excel Automation & Learn to “Make Excel Do Your Work For You”

s

Watch Us Make a Calendar In Excel On YouTube:

This website uses cookies to improve your experience. We’ll assume you’re ok with this, but you can opt-out if you wish. Cookie settingsACCEPT

Wait A Second!

Thank you for visiting! Here’s a FREE gift for you!

Enroll In My FREE VBA Crash Course For FREE!

Learn how to write macros from scratch, make buttons and simple procedures to automate tasks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
Option Explicit
'---------------------------------------------------------------------------------------
' Решение       : Календарь
' Дата и время  : 14 января 2015  23:02
' Автор         : Night Ranger
'                 Яндекс.Деньги - 410012757639478
'                 [email]Exingsteem@yandex.ru[/email]
'                 [url]https://www.cyberforum.ru/vba/[/url]
' Описание      : Этот пример наглядно демонстрирует, как можно использовать календарь
'                 без подключения его к проекту, для этого нужна только форма
'                 совместимость версий любая
'
'                 В этой версии, теперь есть возможность запускать календарь от процедуры
'                 ShowCalendar, и указать там параметры SetDate и UnderRussianStandard
'                 Добавленна кнопка Ok, и форма помнит свою позицию
'---------------------------------------------------------------------------------------
Const jstart = 8, istart = 8 'Стартовые точки
Const gap = 5 'Разрыв
Const twip = 18 'Прямоугольник
Const cc = 6 'Размерность массива
Dim tt(cc, cc) As MSForms.ToggleButton, lb As MSForms.Label
Dim WithEvents fr As MSForms.Frame, WithEvents tb As MSForms.ToggleButton, WithEvents btn As MSForms.CommandButton
Dim WithEvents cbMonth As MSForms.ComboBox, WithEvents cbYear As MSForms.ComboBox
Dim WithEvents chbx As MSForms.CheckBox, WithEvents ok As MSForms.CommandButton
Dim iNext&, cr As Boolean, i&, j&, jj&, v, a$(), tbClick As Boolean, URStandard As Boolean
 
Public ThisDate As Date 'Переменная в которой храниться выбранная дата
 
Private Sub ok_Click()
    'Здесь могут быть дальнейшие инструкции после выбора даты
    'Например дату в удобном формате можно поместить в активную ячейку
    '----------------------------------------------------------------
    
    '
    '
    '
 
    ActiveCell = TextResult
    '----------------------------------------------------------------
    If chbx.Value Then Me.Hide
End Sub
 
Public Sub ShowCalendar( _
    Optional ByVal SetDate As Date, _
    Optional ByVal UnderRussianStandard As Boolean = 1)
    'ShowCalendar -Процедура вызова с параметрами
    'SetDate -Устанавливает возможность показа календаря c этой даты
    'UnderRussianStandard -Устанавливает возможность исправлять: 1 январь на 1 января
    If CDbl(SetDate) Then
        cr = False
        ThisDate = SetDate
        cbMonth.ListIndex = Month(ThisDate) - 1
        cbYear.Text = Year(ThisDate): cr = True: Update
    End If
    URStandard = UnderRussianStandard
    Me.Show
End Sub
 
Private Function TextResult$()
    TextResult = FormatDateTime(ThisDate, vbLongDate)
    If URStandard Then
        TextResult = Format(ThisDate, "[$-FC19]d mmmm yyyy г.")
        
'        a = Split(TextResult)
'        If Right$(a(1), 1) Like "[йЙьЬ]" Then
'            Mid$(a(1), Len(a(1)), 1) = "я"
'        ElseIf Right$(a(1), 1) Like "[Тт]" Then a(1) = a(1) & "а"
'        End If
'        TextResult = Join(a)
    End If
End Function
 
 
 
Private Sub UserForm_Initialize()
    Dim maxWidth&, Width1&, jNext&
    maxWidth = twip * (cc + 1) * 2: Width1 = maxWidth  2: iNext = istart: jNext = jstart
    ThisDate = Date: Me.Caption = "Календарь"
    Set fr = Me.Controls.Add("Forms.Frame.1", "fr")
    Set lb = Me.Controls.Add("Forms.Label.1", "lb")
    Set cbMonth = Me.Controls.Add("Forms.ComboBox.1", "cbMonth")
    Set cbYear = Me.Controls.Add("Forms.ComboBox.1", "cbYear")
    Set btn = Me.Controls.Add("Forms.CommandButton.1", "btn")
    Set ok = Me.Controls.Add("Forms.CommandButton.1", "ok")
    Set chbx = Me.Controls.Add("Forms.CheckBox.1", "chbx")
    
    With lb: .Move jstart, istart, Width1
        .Font.Size = 15: .Font.Bold = 1
        iNext = iNext + .Height + gap
        jNext = jNext + .Width + gap
    End With
    With cbMonth: .Move jNext, istart, (Width1 - gap * 2)  2, lb.Height: .Style = 2
        For i = 1 To 12: .AddItem Format(DateSerial(0, i, 1), "mmmm"): Next
        jNext = jNext + .Width + gap
    End With
    With cbYear: .Move jNext, istart, (Width1 - gap * 2)  2, lb.Height: .Style = 2
        For i = 1899 To Year(ThisDate) + 100
            .AddItem CStr(i)
        Next
    End With
    
    iNext = lb.Top + lb.Height + gap
    
    With fr: .Move jstart, iNext, maxWidth, twip * (cc + 1)
        .Enabled = 0
        .SpecialEffect = 0
    End With
    For i = 0 To cc: For j = 0 To cc
        Set tt(j, i) = fr.Controls.Add("Forms.ToggleButton.1", "tt" & i & j)
        With tt(j, i):  .Move j * twip * 2, i * twip, twip * 2, twip: .Locked = i = 0
        .ForeColor = IIf(j >= 5, vbRed, vbBlue)
        .BackColor = IIf(i, vbButtonFace, vbScrollBars)
    End With: Next j, i
    jNext = jstart
    With ok: .Move jNext, iNext + fr.Height + gap, lb.Width, lb.Height: .Caption = "Ok"
        .AutoSize = 1: jNext = jNext + .Width + gap
    End With
    
    With btn: .Move jNext, iNext + fr.Height + gap, lb.Width, lb.Height: .Caption = "Сегодня"
        .AutoSize = 1: jNext = jNext + .Width + gap
    End With
 
    With chbx: .Move jNext, btn.Top, (jstart + maxWidth) - jNext
        .Caption = "Скрываться после выбора или Ok"
        .Value = GetSetting("Ms Office", "Calendar", "chbx", chbx.Value)
    End With
    
 
    Call btn_Click: Filling: lbUpdate
 
    With Me
        .Height = btn.Top + twip * 3
        .Width = jstart + maxWidth + twip
        If Application.Left > -100 Then
            .StartUpPosition = 0
            .Left = GetSetting("Ms Office", "Calendar", "Left", .Left)
            .Top = GetSetting("Ms Office", "Calendar", "Top", .Top)
            If .Left <= 0 Or .Left > (Application.Left + Application.Width - 100) Or _
            .Top <= 0 Or .Top > (Application.Top + Application.Height - 100) Then
                'Если сохраненная ранее позиция вышла за предел экрана
                .StartUpPosition = 2
            End If
        End If
    End With
 
End Sub
 
Private Sub lbUpdate()
    If cr = False Then Exit Sub
    lb.Caption = Format(ThisDate, "mmmm yyyy")
    If Split(lb.Caption)(0) <> cbMonth.Text Then
        ThisDate = DateSerial(Year(ThisDate), cbMonth.ListIndex + 2, 0)
         lb.Caption = Format(ThisDate, "mmmm yyyy")
    End If
End Sub
 
Private Sub btn_Click()
    cr = False
    ThisDate = Date
    cbMonth.ListIndex = Month(ThisDate) - 1
    cbYear.Text = Year(ThisDate): cr = True: Update
    
End Sub
Private Sub cbMonth_Click()
    If cr = False Then Exit Sub
    ThisDate = DateSerial(Year(ThisDate), cbMonth.ListIndex + 1, Day(ThisDate))
    Update
End Sub
Private Sub cbYear_Click()
     If cr = False Then Exit Sub
    ThisDate = DateSerial(cbYear.Text, Month(ThisDate), Day(ThisDate)): Update
End Sub
 
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    On Error Resume Next: Err.Clear: Set tb = tt((X - jstart)  twip  2, (Y - iNext)  twip)
    If Err = 0 Then
        With tb
            If .Enabled And .Locked = False Then
                For i = 1 To cc: For j = 0 To cc: With tt(j, i)
                    If (.Name = tb.Name) Then
                        ThisDate = DateSerial(cbYear.Text, cbMonth.ListIndex + 1, .Caption)
                        .Value = 1: tbClick = 1: tb_Click: tbClick = 0 'Выбор произведен !
                    Else: .Value = 0
                    End If
    End With: Next j, i: End If: End With: End If
End Sub
 
Private Sub chbx_Click()
    If cr = False Then Exit Sub
    SaveSetting "Ms Office", "Calendar", "chbx", chbx.Value
End Sub
 
Sub Filling()
    For j = 0 To cc  'Понедельники вторники даты и тд
        With tt(j, 0): .Caption = WeekdayName(j + 1, 1, vbMonday): .Font.Bold = 1: End With
    Next: j = 0
    While Weekday(DateSerial(Year(ThisDate), Month(ThisDate), j)) <> 1: j = j - 1: Wend: jj = j
    For i = 1 To cc: For j = 0 To cc: v = DateSerial(Year(ThisDate), Month(ThisDate), jj) + 1
        With tt(j, i): .Caption = Day(v): .Enabled = Month(v) = Month(ThisDate)
            .Value = .Enabled And .Caption = Day(ThisDate)
    End With: jj = jj + 1: Next j, i
End Sub
Private Sub Update(): Call lbUpdate:  Filling: End Sub
Private Sub tb_Click(): If tbClick = False Then Exit Sub Else ok_Click
End Sub
 
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    With Me 'Перед закрытием запомнить позицию
        SaveSetting "Ms Office", "Calendar", "Left", .Left
        SaveSetting "Ms Office", "Calendar", "Top", .Top
    End With
End Sub





VBA-Calendar

  • Purpose & General Info
  • Explanation Github folders
  • Installation
  • Other info

Philosophy

In this repository you can find all sort of VBA code that makes things easier in Microsoft Office Excel.
Some of the code is for daily use, while other is just for fun.

However, the reason this repository was/is created is to share my VBA code (to make a Calendar per month) with you. This is also why this repo is called VBA-Calendar

Explanation Github folders

  • All the code can be found in the folder Code
  • The name of the files tells you what it is about

The .xlsm file Agenda.xlsm belongs to the code:

  1. Calendar per Month
  2. Select Day

Installation

To install the VBA code in Excel follow these steps (for Windows):

  1. Open Excel
  2. Press Alt and F11 on your keyboard -> this opens the Microsoft Visual Basic for Applications
  3. Click on File
  4. Click on Import file
    image

Or If you copy the text of my files


Other Info

Support

If you want to buy me a cup of coffee or want to support me, you can donate via PayPal

➡ Read the Contributing.md for more info

For question see here

Author: Oscar Cronquist Article last updated on October 03, 2019

This workbook contains two worksheets, one worksheet shows a calendar and the other worksheet is used to store events. The calendar sheet allows you to enter a year and use a drop down list to select a month.

A small VBA event code tracks which cell you have selected and shows the corresponding events accordingly.

How this workbook works

The animated image above shows how to enter data and how to select a given date. Today’s date is highlighted yellow, days with one or more events are also highlighted, in this example blue.

Excel extracts data dynamically meaning the named range grows automatically when new data is entered, we don’t need to change the formula cell references.

How I created the calendar

Table of Contents

  1. Calendar
    1. Drop down lists
    2. Headers
    3. Calculating dates (formula)
  2. Conditional formatting
    1. Today
    2. Dates not in selected month
    3. Events
  3. Formulas
    1. Dynamic named range
    2. Calendar sheet
    3. How to create an array formula
  4. Visual basic for applications
  5. Get excel *.xlsm file

Drop down lists

Select year

  1. Select cell B2
  2. Go to tab «Data»
  3. Press with left mouse button on «Data Validation» button
  4. Allow: List
  5. Source:2012,2013,2014,2015,2016
  6. Press with left mouse button on OK

Select month

  1. Select cell E4
  2. Go to tab «Data»
  3. Press with left mouse button on «Data Validation» button
  4. Allow: List
  5. Source:January, February, March, April, May, June, July, August, September, October, November, December
  6. Press with left mouse button on OK

Headers

Type Year: in cell B2, Month: in cell E2 and so on…

Calculating dates (formula)

  1. Select cell B5
  2. Formula:

    =DATE($C$2,MATCH($E$2,{«January»; «February»; «March»; «April»; «May»; «June»; «July»; «August»; «September»; «October»; «November»; «December»},0),1)-WEEKDAY(DATE($C$2,MATCH($E$2,{«January»; «February»; «March»; «April»; «May»; «June»; «July»; «August»; «September»; «October»; «November»; «December»},0),1),2)+1

  3. Select cell B6
  4. Formula:

    =B5+1

  5. Copy cell B6 (Ctrl + c)
  6. Select cell range D5:H5
  7. Paste  (Ctrl + v)
  8. Select cell B6
  9. Formula:

    =B5+7

  10. Copy cell range C5:H5
  11. Select cell range C6:H6
  12. Paste (Ctrl + v)
  13. Copy cell range B6:H6 (Ctrl + c)
  14. Select cell range B7:H10
  15. Paste (Ctrl + v)

Conditional formatting

Highlight Today

  1.  Select cell range B5:H10
  2. Go to tab «Home»
  3. Press with left mouse button on «Conditional formatting» button
  4. Press with left mouse button on «New Rule…»
  5. Press with left mouse button on «Use a formula to determine which cells to format»
  6. Format values where this formula is true:
    =B5=TODAY()
  7. Press with left mouse button on «Format…» button
  8. Go to «Fill» tab
  9. Pick a color
  10. Press with left mouse button on OK
  11. Press with left mouse button on OK

Change font color for dates not in selected month

  1. Repeat 1-5 steps above
  2. =MONTH(B5)<>MONTH($B$6)
  3. Press with left mouse button on «Format…» button
  4. Go to «Font» tab
  5. Pick a color
  6. Press with left mouse button on OK
  7. Press with left mouse button on OK

Highlight days with events

  1. Repeat 1-5 steps above
  2. =OR(B5=INT(INDEX(Data,0,1)))
  3. Press with left mouse button on «Format…» button
  4. Go to «Fill» tab
  5. Pick a color
  6. Press with left mouse button on OK
  7. Press with left mouse button on OK

Formulas

Dynamic named range

  1. Select sheet «Data»
  2. Go to tab «Formulas»
  3. Press with left mouse button on «Name Manager» button
  4. Press with left mouse button on «New…»
  5. Name: Data
  6. Refers to:
    =OFFSET(Data!$A$2,,,COUNTA(Data!$A$1:$A$1000)-1,3)
  7. Press with left mouse button on OK!
  8. Press with left mouse button on Close

Event formulas

  1. Select sheet «Calendar»
  2. Select cell B13
  3. Array formula:

    =IFERROR(INT(INDEX(Data, SMALL(IF(INT(INDEX(Data, 0, 1))=$G$2, MATCH(ROW(Data), ROW(Data)), «»), ROW(A1)), COLUMN(A1))), «»)

  4. Enter this formula as an array formula, see these steps if you don’t know how.
  5. Select cell D13
  6. Array formula:

    =IFERROR(INDEX(Data, SMALL(IF(INT(INDEX(Data, 0, 1))=$G$2, MATCH(ROW(Data), ROW(Data)), «»), ROW(B1)), COLUMN(A1)), «»)

  7. Select cell F13
  8. Array formula:

    =IFERROR(INDEX(Data, SMALL(IF(INT(INDEX(Data, 0, 1))=$G$2, MATCH(ROW(Data), ROW(Data)), «»), ROW(C1)), COLUMN(B1)), «»)

  9. Select cell H13
  10. Array formula:

    =IFERROR(INDEX(Data, SMALL(IF(INT(INDEX(Data, 0, 1))=$G$2, MATCH(ROW(Data), ROW(Data)), «»), ROW(D1)), COLUMN(C1)), «»)

How to create an array formula

  1. Select a cell
  2. Press with left mouse button on in formula bar
  3. Paste array formula
  4. Press and hold Ctrl + Shift
  5. Press Enter

Visual basic for applications

  1. Press with right mouse button on on Calendar sheet
  2. Press with left mouse button on «View code»
  3. Copy vba code below.
    'Event code that is rund every time a cell is selected in worksheet Calendar
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    'Check if selected cell address is in cell range B5:H10
    If Not Intersect(Target, Range("B5:H10")) Is Nothing Then
    
    'Save date to cell G2
    Range("G2") = Target.Value
    End If
    
    End Sub
    
  4. Paste to worksheet module.

Note, save your workbook with file extension *.xlsm in order to attach the code to the workbook.

Hide value in cell G2

  1. Select cell G2
  2. Press Ctrl + 1
  3. Go to tab «Number»
  4. Select category: Custom
  5. Type ;;;
  6. Press with left mouse button on OK!

Calendar-event-finish

Calendar category

test

Calendar – monthly view
This article describes how to build a calendar showing all days in a chosen month with corresponding scheduled events. What’s […]

test

Plot date ranges in a calendar part 2
I will in this article demonstrate a calendar that automatically highlights dates based on date ranges, the calendar populates names […]

test

test

Plot date ranges in a calendar
The image above demonstrates cells highlighted using a conditional formatting formula based on a table containing date ranges. The calendar […]

test

Heat map yearly calendar
The calendar shown in the image above highlights events based on frequency. It is made only with a few conditional […]

test

Highlight events in a yearly calendar
This article demonstrates how to highlight given date ranges in a yearly calendar, this calendar allows you to change the […]

test

Monthly calendar template
The image above shows a calendar that is dynamic meaning you choose year and month and the calendar instantly updates […]

test

Create a drop down calendar
The drop down calendar in the image above uses a «calculation» sheet and a named range. You can copy the drop-down […]

test

test

Pivot Table calendar
This article demonstrates how to build a calendar in Excel. The calendar is created as a Pivot Table which makes […]

test

Calendar with scheduling [vba]
Here is my contribution to all excel calendars out there. My calendar is created in Excel 2007 and uses both […]

test

Yet another Excel Calendar
What’s on this page How to use this Excel Calendar How to add events How I built this calendar Worksheet […]

test

test

Monthly calendar template #2
I have created another monthly calendar template for you to get. Select a month and year in cells A1 and […]

test

Weekly appointment calendar
This weekly calendar is easy to customize, you can change calendar settings in sheet «Settings»: Start date (preferably a Sunday or […]

If then else statement category

Macro category

test

Save invoice data [VBA]
This article demonstrates a macro that copies values between sheets. I am using the invoice template workbook. This macro copies […]

test

Open Excel files in a folder [VBA]
This tutorial shows you how to list excel files in a specific folder and create adjacent checkboxes, using VBA. The […]

test

test

Working with COMBO BOXES [Form Controls]
This blog post demonstrates how to create, populate and change comboboxes (form control) programmatically. Form controls are not as flexible […]

test

Identify missing numbers in a column
The image above shows an array formula in cell D6 that extracts missing numbers i cell range B3:B7, the lower […]

test

test

test

Working with FILES
In this blog article, I will demonstrate basic file copying techniques using VBA (Visual Basic for Applications). I will also […]

test

Auto resize columns as you type
Excel does not resize columns as you type by default as the image above demonstrates. You can easily resize all […]

test

test

test

Create a Print button [VBA]
This article describes how to create a button and place it on an Excel worksheet then assign a macro to […]

test

test

test

test

test

test

test

Functions in this article

More than 1300 Excel formulas

Excel formula categories

Excel categories

Latest updated articles.

More than 300 Excel functions with detailed information including syntax, arguments, return values, and examples for most of the functions used in Excel formulas.

More than 1300 formulas organized in subcategories.

Excel Tables simplifies your work with data, adding or removing data, filtering, totals, sorting, enhance readability using cell formatting, cell references, formulas, and more.

Allows you to filter data based on selected value , a given text, or other criteria. It also lets you filter existing data or move filtered values to a new location.

Lets you control what a user can type into a cell. It allows you to specifiy conditions and show a custom message if entered data is not valid.

Lets the user work more efficiently by showing a list that the user can select a value from. This lets you control what is shown in the list and is faster than typing into a cell.

Lets you name one or more cells, this makes it easier to find cells using the Name box, read and understand formulas containing names instead of cell references.

The Excel Solver is a free add-in that uses objective cells, constraints based on formulas on a worksheet to perform what-if analysis and other decision problems like permutations and combinations.

An Excel feature that lets you visualize data in a graph.

Format cells or cell values based a condition or criteria, there a multiple built-in Conditional Formatting tools you can use or use a custom-made conditional formatting formula.

Lets you quickly summarize vast amounts of data in a very user-friendly way. This powerful Excel feature lets you then analyze, organize and categorize important data efficiently.

VBA stands for Visual Basic for Applications and is a computer programming language developed by Microsoft, it allows you to automate time-consuming tasks and create custom functions.

A program or subroutine built in VBA that anyone can create. Use the macro-recorder to quickly create your own VBA macros.

UDF stands for User Defined Functions and is custom built functions anyone can create.

A list of all published articles.

Понравилась статья? Поделить с друзьями:
  • Календарь vba excel 2016
  • Календарь vba excel 2013
  • Календарь excel на одном листе
  • Календарь excel дни рождения
  • Календарь 2023 в excel для составления графика работы