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 8713247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:17:58+00:00 2026-06-13T05:17:58+00:00

Hi was wondering through internet for my solution. considering my excel sheet as array

  • 0

Hi was wondering through internet for my solution. considering my excel sheet as array i want to get data based on row and column index, how can i do this. i am not getting a clue to implement this my excel sheet look like below

please help in this. i am getting mad of trying different methods.

my requirement is if i give R3,C2 in console ,i should get 4 as my answer.
i was using Excel.interop for getting this,you can suggest solution by other methods too.
thanking you in anticipation.

  • 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-06-13T05:17:59+00:00Added an answer on June 13, 2026 at 5:17 am
    using System;
    using Excel=Microsoft.Office.Interop.Excel;
    
    namespace ReadingExcelBasedOnRowColumn
    {
    
    
        class Program
        {
            static void Main(string[] args)
            {
                Excel.Application xlApp = new Excel.Application();
                Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"C:\Users\SaiKiran\Desktop\MyExcl2.xlsx");
                Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
                Excel.Range xlRange = xlWorksheet.UsedRange;
                Console.WriteLine("enter x and y value:");
                int x = Convert.ToInt32(Console.ReadLine());
                int y = Convert.ToInt32(Console.ReadLine());
                if (xlRange != null)
                {
                    int nRows = xlRange.Rows.Count;
                    int nCols = xlRange.Columns.Count;
                    for (int iRow = 1; iRow <= nRows; iRow++)
                    {
    
                        for (int iCount = 1; iCount <= nCols; iCount++)
                        {   
    
                            xlRange = (Microsoft.Office.Interop.Excel.Range)xlWorksheet.Cells[x, y];
                            Console.WriteLine(xlRange.Text);
                            Console.ReadLine();
                        }
                    }
    
                }
    
            }
        }
    }
    

    i got answer.. after struggling two days

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

Sidebar

Related Questions

I am crunching through many gigabytes of text data and I was wondering if
I am wondering how I can loop through a certain column in a table
I was wondering if there was any way through C# or C++ to send
I'm going through the django tutorials and I was wondering what happens when you
I was wondering if you could protect xml files through forms authentication in ASP.NET
I am wondering if maybe ReSharper is able to run through every class and
I am wondering what is the best way to go iterate through all the
I was going through the RMI documents and was wondering if it is possible
I'm working through the NerdDinner MVC tutorial and came across this and was wondering
I'm very new to Oracle and was wondering if there's a way either through

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.