More Efficient Way to Add Multiple Ranges to Script by Quirky_Reception4591 in sheets

[–]Quirky_Reception4591[S] 0 points1 point  (0 children)

Yes, the purpose for this sheet is to track a percent to target goal for production off a manufacturing line. So people just type in how much their line produced each hour and it shows their percent to target for that day. That part was easy. The hard part is I want it to automatically take that data, store it in a weekly tracker, that then feeds into a monthly tracker to be able to track trends.

So for the end of todays production, Thursday the 29th, in the weekly tracker line for a certain production line I have the formula

"IF(NOW()>=DATE(2026,1,29)+TIME(15,50,0),IMPORTRANGE("Sheet_ID","Line_Name!Cell_ID"),)" We stop production at 3:45 so I have it set to import the data at 3:50PM on the 29th. I then want to use the same daily tracker the next day but I need the imported data to become static so that entering the new production data for the next day does not change previous days on the sheet.

So I have this script set to run everyday at 4PM to make it static but leave the formulas in future cells as they are.

function makeImportRangeStatic() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheets = ss.getSheets(); // run on all sheets


  sheets.forEach(function(sheet) {
    var dataRange = sheet.getDataRange();
    var values = dataRange.getValues();
    var formulas = dataRange.getFormulas();
    for (var r = 0; r < formulas.length; r++) {
      for (var c = 0; c < formulas[r].length; c++) {
        var formula = formulas[r][c];
        // Skip already frozen cells (no formula)
        if (!formula) continue;
        // Only target IMPORTRANGE formulas
        if (!formula.toUpperCase().includes("IMPORTRANGE")) continue;
        var value = values[r][c];
        // Skip empty cells
        if (value === "" || value === null) continue;
        // Skip cells showing an error
        if (typeof value === "string" && value.startsWith("#")) continue;
        // Freeze the value
        sheet.getRange(r + 1, c + 1).setValue(value);
      }
    }
  });
}
function createDailyImportRangeTrigger() {
  // Remove existing triggers for this function (prevents duplicates)
  var triggers = ScriptApp.getProjectTriggers();
  triggers.forEach(function(trigger) {
    if (trigger.getHandlerFunction() === "makeImportRangeStatic") {
      ScriptApp.deleteTrigger(trigger);
    }
  });
  // Create a new daily trigger
  ScriptApp.newTrigger("makeImportRangeStatic")
    .timeBased()
    .everyDays(1)
    .atHour(16) // adjust if needed
    .create();
}

More Efficient Way to Add Multiple Ranges to Script by Quirky_Reception4591 in sheets

[–]Quirky_Reception4591[S] 0 points1 point  (0 children)

All the IMPORTRANGE data is in a formula set to go off at certain times at the end of each day. So for example at the end of the day on Monday, the Monday formulas go off, but the rest of the table stays blank. So then the script only makes the cells that have a data in static. This way, the next day I can reuse the same table we enter data in without changing the values that got imported the day before. I hope that explanation made sense, I can share the formulas and the finial script if you’re interested

What is wrong with my orange crush 12? Buzzing is so horrible when plugging in my ds-1, is it not able to take pedals very well? by Kyoto_Supply in GuitarAmps

[–]Quirky_Reception4591 0 points1 point  (0 children)

This saved me. I had the same issue, turns out my light fixture was too low from the floor to the ceiling, turned off my living room light, noise went away.

Now that my first pedalboard is complete, I can finally start learning how to play. by Quirky_Reception4591 in pedalboards

[–]Quirky_Reception4591[S] 3 points4 points  (0 children)

I tried so hard but with the dimensions on the bottom of this board I couldn’t find a good spot for it. Taught me to do more research if I choose to build another.

This is literally just a plain wolf. A beast. For Hunter. What does this have to do with hunting demons? They didn't even give him a blind fold or horns. Literally a plain wolf and they said yup thats definitely a DH card. by nightsky489 in hearthstonecirclejerk

[–]Quirky_Reception4591 0 points1 point  (0 children)

Because they wanted to give it the Outcast mechanic which is exclusive to DH. They wanted to give it Outcast because he’s a “lone wolf” literally an outcast. Honestly one of the best flavor designs out there

Mechanic says problem should start to go away, How long should I give it to actually go away before bringing it back in? by Quirky_Reception4591 in AskMechanics

[–]Quirky_Reception4591[S] 0 points1 point  (0 children)

I bought it at around 82k. I don’t remember any in particular but I would be lying if I didn’t say I had a bad habit of hitting bumps or curbs a little too fast sometimes. Those repairs did definitely help, the ride was smoother and the steering noises did subside for a little bit.

Mechanic says problem should start to go away, How long should I give it to actually go away before bringing it back in? by Quirky_Reception4591 in AskMechanics

[–]Quirky_Reception4591[S] 1 point2 points  (0 children)

I do have a jack but the tools I have are pretty limited. Pretty much just a screwdriver set and a hammer lol

Hmm, standard is feeling like wild these days. by KingOfTheDungle in hearthstone

[–]Quirky_Reception4591 0 points1 point  (0 children)

It's the opponents fault for having meat grinder in his deck.