在excel中添加超链接,去除excel中的超链接

问题:excel怎么着编辑宏,给叁个表格里的每叁个单元格文字添加超链接对应另二个报表里的每二个单元格?

  1. 先复制包罗全体要刨除超链接的单元格
  2. 【选拔性粘贴】–》数值。

在excel中添加超链接,去除excel中的超链接。一.新建3个类型


回答:

二.给品种拉长引用:Microsoft Excel 1二.0 Object Library (二〇〇五版本)

本文首要指标是把excel的数目整理成sql脚本。

您好,您的意趣是要给每一个工作表成立目录吧,点击单元格中对应的工作表名称就跳转到对应的干活表去,那里给您分享什么以超链接的款型创制工作表目录。

using Excel = Microsoft.Office.Interop.Excel;
  1. 创设excel文书档案,并编辑列表对应的多少库表,比如本身把t_third_class所有的性质添加到excel中;

诸如下图是贰个excel工作簿,里面有五个工作表,必要创立1个干活表目录,在目录里点击相应的工作表名称就能急忙跳转到对应工作表中。

3.对excel的简练操作:如下代码“添加超链接”等。

![](https://upload-images.jianshu.io/upload_images/1037811-5b15ab91ce0211d2.png)

商品.png

图片 1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Excel = Microsoft.Office.Interop.Excel;

namespace ExcelExample
{
    class Program
    {
        static void Main(string[] args)
        {
            Excel.Application excelApp = new Excel.Application();  // Creates a new Excel Application
            excelApp.Visible = true;  // Makes Excel visible to the user.

            // The following line if uncommented adds a new workbook
            //Excel.Workbook newWorkbook = excelApp.Workbooks.Add();

            // The following code opens an existing workbook
            string workbookPath = "F:\\11.xlsx";  // Add your own path here

            Excel.Workbook excelWorkbook = null;

            try
            {
                excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0,
                    false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true,
                    false, 0, true, false, false);
            }
            catch
            {
                //Create a new workbook if the existing workbook failed to open.
                excelWorkbook = excelApp.Workbooks.Add();
            }

            // The following gets the Worksheets collection
            Excel.Sheets excelSheets = excelWorkbook.Worksheets;

            // The following gets Sheet1 for editing
            string currentSheet = "Sheet1";
            Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet);

            // The following gets cell A1 for editing
            Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "B1");

            // The following sets cell A1's value to "Hi There"
            excelCell.Value2 = "Hi There";

            Excel.Worksheet excelWorksheet2 = (Excel.Worksheet)excelSheets.get_Item("Sheet2");
            Excel.Range excelCell2 = (Excel.Range)excelWorksheet2.get_Range("A1", Type.Missing);
            excelCell2.Value2 = "Hi Here";

            // Add hyperlinks to the cell A1
            //excelWorksheet.Hyperlinks.Add(excelCell,"http:\\www.baidu.com",Type.Missing,"baidu",Type.Missing);

            // Add hyperlinks from "sheet1 A1" to "sheet2 A1"
            excelWorksheet.Hyperlinks.Add(excelCell, "#Sheet2!A1", Type.Missing, Type.Missing, Type.Missing);

            // Close the excel workbook
            //excelWorkbook.Close(true,Type.Missing,Type.Missing);

            //Quit the excel app
            //excelApp.Quit();
        }
    }
}
  1. 接下去你要求在F贰单元格做如下编辑;