Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 480541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:54:12+00:00 2026-05-13T00:54:12+00:00

In excel it is possible to highlight a range of cells and view the

  • 0

In excel it is possible to highlight a range of cells and view the ‘sum’ in the ‘status bar’.

Can this be done in IE6 using Javascript and a HTML table ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:54:12+00:00Added an answer on May 13, 2026 at 12:54 am

    Here is some code to get you started, using jQuery. Of course there are many ways you could improve on it.

    (EDIT: One thing to check is how well it works in IE. I think you need to add something like this.onselectstart = function() {return false}; in the mousedown event handlers to disable text selection in IE, but I don’t happen to have IE handy at the moment.)

    <html>
    <head>
    <style type="text/css">
        .sel {background-color: #99ff33; }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    <script>
    $(function () {
        function col(cell) {
            return cell.parent().children("td").index(cell);
        }
    
        var start = null;
    
        function selectTo(cell) {
            if (start == null)
                return;
            $("td").removeClass("sel");
            var stop = $(cell);
            var tbl = start.closest("table");
            var rs = tbl.children("tbody").children("tr");
            var r0 = rs.index(start.parent()), c0 = col(start);
            var r1 = rs.index(stop.parent()), c1 = col(stop);
            var sum = 0;
            for (var i = r0; i <= r1; i++) {
                var cells = $(rs.get(i)).children("td");
                for (var j = c0; j <= c1; j++) {
                    var cell = $(cells.get(j));
                    cell.addClass("sel");
                    sum += Number(cell.html());
                }
            }
            $("#total").html(""+sum);
        }
    
        $("table").mousedown(function () {
            return false;
        });
    
        $("td").mousedown(function () {
            start = $(this);
            selectTo(this);
            return false;
        });
    
        $("td").mouseover(function () {
            selectTo(this);
        });
    
        $("td").mouseup(function () {
            selectTo(this);
            start = null;
        });
    
        $("body").mouseup(function () {
            start = null;
        });
    });
    </script>
    
    <body>
      <table>
        <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr>
        <tr> <td>2</td> <td>4</td> <td>6</td> <td>8</td> </tr>
        <tr> <td>3</td> <td>6</td> <td>9</td> <td>12</td> </tr>
      </table>
      <p>Total of selected elements: <span id="total"></span></p>
    </body>
    
    </html>
    

    Demo here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to select a range of cells in excel- A1:B10 and then
Is it possible using Excel's sumifs to find the sum of elements of a
Possible Duplicate: How to get the range of occupied cells in excel sheet Im
Possible Duplicate: Excel show leading zero in formula bar I am using an excel
Following the questions: Javascript or Flash export to CSV/Excel Is it possible to use
Possible Duplicate: In need of JavaScript Solution for Exporting table to Excel which works
Possible Duplicate: How to properly clean up Excel interop objects in C# I've this
Im looking for a way to do this in Excel 2010 using VBA. It
Possible Duplicate: How can I export tables to excel from a webpage EDIT: Just
Possible Duplicate: Generating excel documents programmatically I want to generate excel reports using Java/J2EE.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.