How to hide a row based on cell value with CodeEditor

Anonymous
2023-03-23T17:47:24+00:00

Hello MS Community!

I am looking for a script in Code Script (not VBA) to hide a row based on a cell value. For example (refer to the below) IF Column A= "No", Hide Row 3. I will have a larger table associated with multiple "No"s, so being able to apply the logic to the larger sheet would be necessary. Thank you!

Image

Microsoft 365 and Office | Excel | Other | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Anonymous
    2023-03-23T19:51:17+00:00

    Hi Anna,

    I really appreciate your help. Unfortunately I am still getting errors. Please see below

    0 comments No comments
  2. Anonymous
    2023-03-23T20:16:27+00:00

    It looks like the errors you're seeing are related to the TypeScript compiler not recognizing some of the syntax used in the code. Specifically, it's complaining about the async keyword and the => arrow function syntax.

    To fix these issues, you'll need to ensure that you're using a version of TypeScript that supports these features. Here's how you can do that:

    Make sure you have the latest version of the Script Lab add-in installed in your Excel file. You can download it from the Microsoft Store if you haven't already.

    In the Script Lab Code Editor, click on the "Settings" icon in the top-right corner of the window (it looks like a gear).

    In the Settings dialog, make sure that the "TypeScript version" dropdown is set to "Latest".

    Click "Save" to save the settings and close the dialog.

    Try running the script again to see if the errors have been resolved.

    0 comments No comments