Cell Blinking
Solved
CALI
-
eric2027 Posted messages 296 Status Member -
eric2027 Posted messages 296 Status Member -
Hello,
I have a calendar with birthdays to celebrate for which a macro colors them, and I would like those to blink when it's the big day.
Thank you in advance for your help.
Best regards,
I have a calendar with birthdays to celebrate for which a macro colors them, and I would like those to blink when it's the big day.
Thank you in advance for your help.
Best regards,
23 answers
- 1
- 2
Next
-
-
Hello,
Check out this discussion to get you started
https://forums.commentcamarche.net/forum/affich-32151851-creer-une-macro-pour-declencher-clignotement-de-cellules?page=2
--
See you
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge. -
Hello CALI,
I think you should take a detailed look at Mike-31's proposal (regards) and then you just need to adapt the spreadsheet according to your needs, everything is there and in a nice way.
--
Regards.
The Penguin -
Hello,
Here is an example:
http://www.cjoint.com/c/EHBjkGUh1GQ
--
@+ Le Pivert -
re,
I'm sorry, but I can't adapt this macro to my file. I know I'm not very skilled, so I really need help.
Thank you -
Hi,
if you could start by making your anonymized file available to us, it might be possible to adjust a code
to attach your file from this link
https://www.cjoint.com/
--
See you,
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge. -
-
Your link is inactive. You should register, it's free. You would receive messages when someone replies to you. The links are blue and clickable.
Here’s another example that fits all the binders:
Press Alt F11 to access the editor.
The codes are in module1 and ThisWorkbook
http://www.cjoint.com/c/EHBpDuRogDQ
--
@+ The Woodpecker-
-
Hi Mike-31,
I can't activate the link.
A starting point for the comments:
Option Explicit Private Sub Workbook_Open() Dim PremCell As String Dim Cell As Range Dim maligne As String Dim madate As Date Dim com As String madate = Format(Date, "d/mm/yyyy") Set Cell = Cells.Find(madate) On Error Resume Next If Not Cell Is Nothing Then PremCell = Cell.Address maligne = Cell.Address(RowAbsolute:=False) 'gives the column and row number e.g.: $G16 Range(maligne).Select 'selects the cell where the date is com = ActiveCell.Comment.Text End If If com = "" Then Else InitFlash End If End Sub
Best regards
-
-
Re,
here is the CALI file
https://www.cjoint.com/c/EHBrxlogKGj
--
A+
Mike-31
A period of failure is an ideal time to sow the seeds of knowledge. -
Hello and thank you both for your patience.
I will try to manage with your send but if you can correct my file, that would be great.
Best regards, -
Here is the modified spreadsheet. I put a dummy birthday for today to check if it's working properly:
http://www.cjoint.com/c/EHCjPvWkD5Q
Mike-31, there’s definitely a way to simplify the code.
It wasn't recognizing the column numbers!
If you could take a look at it
Best regards to both of you
--
@+ Le Pivert -
-
Re,
Sorry for the delay, connection problem, thanks to Pivert for following up, but if you pass by here again
you could keep it simple by displaying the comment of the current day, or if you prefer the blinking option, make the comment blink
to test, paste this code into a module and link the Comman and ArretClign codes to a button or in the ThisWorkbook for automatic launch
Option Explicit
Dim Timer As Date
Dim Cell As Variant
Sub Comman()
For Each Cell In Range("A5:L35")
If Not (Cell.Comment Is Nothing) And Cell = Date Then 'MsgBox Cell.Comment.Text
Cell.Select
Clign
End If
Next
End Sub
Sub Clign()
On Error Resume Next
Timer = Now() + TimeValue("00:00:01") 'the blinking time
Application.OnTime Timer, "Clign"
'Show the alert or make it disappear (alternatively)
With ThisWorkbook
'Comment
With .Sheets("Calendrier").Range(ActiveCell.Address)
.Comment.Visible = Not .Comment.Visible
End With
End With
End Sub
Sub ArretClign()
On Error Resume Next
Application.OnTime Timer, "Clign", , False
'Hide the alert
Sheets("Calendrier").Range(ActiveCell.Address).Comment.Visible = False
End Sub
--
A+
Mike-31
A period of failure is a perfect time to plant the seeds of knowledge. -
Good approach, thank you for this solution.
I modified it to better fit the request:
in a module:
Option Explicit Dim Timer As Date Dim Cell As Variant Sub Comman() For Each Cell In Range("A5:L35") If Not (Cell.Comment Is Nothing) And Cell = Date Then 'MsgBox Cell.Comment.Text Cell.Select Clign End If Next End Sub Sub Clign() On Error Resume Next Static i i = i + 1 'as long as the chosen number of flashes is not reached '(here 5) we continue If i <= 5 Then Timer = Now() + TimeValue("00:00:01") 'the flashing time Application.OnTime Timer, "Clign" 'Show alert or hide it (alternately) With ThisWorkbook 'Comment With .Sheets("Calendrier").Range(ActiveCell.Address) .Comment.Visible = Not .Comment.Visible End With End With Else Application.OnTime Timer, "Clign", , False 'Hide the alert Sheets("Calendrier").Range(ActiveCell.Address).Comment.Visible = True i = 0 End If End Sub
and in the sheet:
Option Explicit Dim f, ligne, cmt Dim mois, jour Private Sub Worksheet_Activate() Application.ScreenUpdating = False [A5:L35].ClearComments [A5:L35].Interior.ColorIndex = xlNone Set f = Sheets("evenement") For ligne = 2 To f.[A65000].End(xlUp).Row cmt = f.Cells(ligne, 1) & " " & f.Cells(ligne, 2) & " " & f.Cells(ligne, 4) mois = Month(f.Cells(ligne, 3)) jour = Day(f.Cells(ligne, 3)) With Sheets("calendrier").Cells(jour + 4, mois) If .Comment Is Nothing Then .AddComment .Comment.Text Text:=cmt .Comment.Shape.TextFrame.AutoSize = True .Interior.ColorIndex = 3 .Comment.Visible = True End With Next ligne Comman 'starts the flashing Application.ScreenUpdating = True End Sub
Best regards
--
@+ Le Pivert -
Hello to both of you and a big thank you again.
I will test this morning and keep you updated.
Best regards, -
Hi,
Thank you for your reply. It is also possible to control the conditional formatting within the same code and choose to either make the cell or the comment blink, or make the cell blink and display the comment of the relevant cell. And if you want to pique curiosity, you can play a song like Happy_Birthday.
--
See you,
Mike-31
A period of failure is a perfect time to plant the seeds of knowledge. -
-
Hello,
While waiting for Mike_31's
http://www.cjoint.com/c/EHFqISKbGRQ
--
See you, Le Pivert -
-
Hi,
here is the file I think is operational, feel free to share your feedback.
currently, the file does not contain any comments, you just need to enter them on the desired dates. Currently, the audio file is intended for noting the birthdays.
the procedure starts automatically when opening the file, when changing tabs, when changing the date, or by using the single button that changes appearance depending on the ongoing procedure
in all cases, the procedure can be stopped with the button or by leaving the sheet
the code runs partially or entirely if today's cell contains a comment
download the ZIP folder and then extract the Anniv folder before testing the Classeur2 file that you can rename
https://www.cjoint.com/c/EIci1gbUZjj
--
See you later
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge.-
-
-
-
Re,
In the folder file, you have two files, the Excel file named Classeur2.xlsm and the audio file named Happy_Birthday.mp3. It is essential that both files are at the same level in the hierarchy, in other words, in the same directory or the file path needs to be reviewed, and this message points out that inconsistency.
Place both files in the same location and everything should work, as proof Cali had no issues. -
-
- 1
- 2
Next