Ok, I have a calendar on my page and each day is a formatted version of that date, eg.
Jan 2021
1 2 3 4
5 6 7 8
etc..
so the 1 cell will contain 1/1/2021 (but formatted to just show '1' [d]) I also have a cell (K5) on that page for a user to enter a date eg:[1/1/2021]
What i'd like is a script that changes the border colour of the day in the calendar if it matches the user entry cell.
The code:
function onEdit(e) {
var ss = SpreadsheetApp.getActive();
var sheet = ss.getActiveSheet();
var date = sheet.getRange("K5").getValue();
if (e.range.getValue()== date) {
e.range.setBorder(true, true, true, true, true, true, "red", SpreadsheetApp.BorderStyle.solid); }
};
This doesn't work and I can't think of a way of having the code work for every cell of the calendar (there are 2 years worth so over 1000 cells). It doesn't need to be onEdit, i was just testing to see if the actual setBorder function worked (which it does) Also, I cant use conditional formatting as I've already used that to change to bg and font colours for something else (and there's no option to change boarder colour anyway)
I've made a mini version with just Jan if you'd like to have a look and see what you can do: https://docs.google.com/spreadsheets/d/1oV4lE8cQB-e2bVc_HgiGM31ivk3uHxPcqsSdLdCxsmQ/edit?usp=sharing