Hello,
in the attached workbook it is possible to insert a letter X in the range C10:AG10
in case of Saturday (sab-sabato) or Sunday (dom-domenica) in range C8:AG8.
it must be a macro because sometimes the letter X must be entered manually
max
Hello,
in the attached workbook it is possible to insert a letter X in the range C10:AG10
in case of Saturday (sab-sabato) or Sunday (dom-domenica) in range C8:AG8.
it must be a macro because sometimes the letter X must be entered manually
max
Hi max_max,
How about this?
Please Login or Register to view this content.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
As a beginner starter :
PHP Code:
Sub Demo()
[C10:AG10].Formula = "=IF(WEEKDAY(C8,2)=6,""X"","""")"
[C10:AG10].Formula = [C10:AG10].Value2
End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Hi arkadi your macro work well.
I have modified with selectionchange:
but non work this:Please Login or Register to view this content.
Dim ws As Worksheet
Range("C10:AG10").Select
Selection.ClearContents
Set ws = ThisWorkbook.Worksheets("CONF")
Remove any Select & Selection, just directly work on objects !
Copy my code to the Foglio3(CONF) worksheet module and see how it works !
Update formula with >5 instead of =6, at bambino level ‼
Last edited by Marc L; 06-06-2019 at 02:28 PM.
hi arkadi:
I can't add other X letters besides the macro ones
------------------------------------------------------------------------------------------------------------------------Please Login or Register to view this content.
hi marcL:
I can't add other X letters besides the macro ones
maxPlease Login or Register to view this content.
My code (even converted to selection change), would not stop manual "X", but you are adding a line that removes ALL "X":Maybe you need code that when your cell C3 (I think it was C3?) changes dates, then you clear that range, but not on "selection change" since that means every time you select any cell, all X's are removed and then only Sat/Sun will have X again.Please Login or Register to view this content.
At every change of month, the X of Saturdays and Sundays must change
but having a chance to add other X manuals (monthly holidays)
Hi arkadi and marcL I removed selectionchange and left the macros
Please Login or Register to view this content.
They work wellPlease Login or Register to view this content.
max
Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED.
Also,you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner
of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
Last edited by Marc L; 06-06-2019 at 05:35 PM.
Hi marcL and arkadi I waited this morning to try the macros in the office and both work.
Thanks again to everyone.
max
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks