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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:27:13+00:00 2026-05-27T02:27:13+00:00

How do you search for merged cells in an excel document with c#? I

  • 0

How do you search for merged cells in an excel document with c#?

I want to manipulate my merged cells in a consistent manner, but I have to know their address to do so.

I have hundreds of, for lack of a better word, tables in Excel and each have merged cells on top of them which I have to move and put to the right of each table.

To do this I need to know how to search for merged cells, and get the addresses of the merged cells with C#. I am currently using Interop.

Also if you think there are simpler ways, with basic excel capabilities within excel, please let me know.

thanks for any help.

  • 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-27T02:27:14+00:00Added an answer on May 27, 2026 at 2:27 am

    If you were using the newer Office products that suport Office Open XML you could probably parse the xml and find the tags that represent merged cells

    The following is an example of a sheet with 2 cells one merged from a1-b1 and a single cell a2.

    There are a few commercial and possibly some open source solutions that would simplify the xml processing.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
        <dimension ref="A1:B2"/>
        <sheetViews>
            <sheetView tabSelected="1" workbookViewId="0">
                <selection activeCell="A2" sqref="A2"/>
            </sheetView>
        </sheetViews>
        <sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>
        <sheetData>
            <row r="1" spans="1:2" x14ac:dyDescent="0.25">
                <c r="A1" s="1" t="s">
                    <v>0</v>
                </c>
                <c r="B1" s="1"/>
            </row>
            <row r="2" spans="1:2" x14ac:dyDescent="0.25">
                <c r="A2" t="s">
                    <v>1</v>
                </c>
            </row>
        </sheetData>
        <mergeCells count="1">
            <mergeCell ref="A1:B1"/>
        </mergeCells>
        <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>
    </worksheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I search for nurple in a file. I found it, great. But now, every
Which search engine would you recommend for a Commerce website? We have millions of
I am trying to develop a complex textual search engine. I have thousands of
I have an ASP.NET application which needs to search a VARCHAR(20) column using lists
I have two JSON objects here, generated through the Google Search API. The URL's
I know how to do a regular php mysql search and display the results.
I have a Wordpress-based website which uses Sphinx as a search engine, with a
I want to search and replace some digits in a text file and that
hi i want to create user search fully driven with sphinx. problem is that
I want to be able to search within the commit logs of svn. I

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.