Skip to main content
dublove
Legend
August 9, 2026
Answered

How to determine whether the selected cell is one row or multiple rows?

  • August 9, 2026
  • 2 replies
  • 33 views

I need to distinguish between the following two situations.
The essence is to distinguish whether it is a single line or multiple lines.

The first option: select 1row (one or more columns).
Second option: Select 2 rows (1 or more columns).

 

    Correct answer Manan Joshi

    Use the following code

    app.selection[0].columnSpan

    It will output 1 for your 1st example and 2 for the 2nd one

    2 replies

    Manan JoshiCommunity ExpertCorrect answer
    Community Expert
    August 10, 2026

    Use the following code

    app.selection[0].columnSpan

    It will output 1 for your 1st example and 2 for the 2nd one

    -Manan
    dublove
    dubloveAuthor
    Legend
    August 10, 2026

    Hi Manan Joshi.

    Thank you very much.

    app.selection[0].columnSpan
    app.selection[0].rowSpan

    Can be perfectly solved