一、选择性粘贴Unicode文本
1. 修改如下文本,指定要显示的图片及其位置、高宽,然后复制
<table><img src="D:\Pictures\015.jpg" width="140" height="140">
<table><img src="D:\Pictures\016.jpg" width="140" height="140">
<table><img src="D:\Pictures\017.jpg" width="140" height="140">
2. excel中设好单元格的高宽
3. 单元格上右键 / 选择性粘贴 / Unicode 文本 / 确定
二、宏自动粘贴Unicode文本
1. excel单元格区域有如下文本:
<table><img src="D:\Pictures\015.jpg" width="140" height="140">
<table><img src="D:\Pictures\016.jpg" width="140" height="140">
<table><img src="D:\Pictures\017.jpg" width="140" height="140">
2. excel中设好单元格的高宽
3. 如下宏代码修改srow和erow,指定开始和结束行号
4. 运行宏
Sub 导入图片()
srow = 1: scol = 1
erow = 4: ecol = 1
ActiveSheet.Range(Cells(srow, scol), Cells(erow, ecol)).Select
For Each Rng In Selection
If Left(Rng, 16) = "<table><img src=" Then
k = WorksheetFunction.Find("height", Rng)
Path = Mid(Rng, 18, k - 32)
Heig = Mid(Rng, k + 8, Len(Rng) - k - 9)
ActiveSheet.Pictures.Insert(Path).Select
Selection.ShapeRange.Height = Heig
Selection.ShapeRange.Left = ActiveSheet.Cells(srow, scol).Left
Selection.ShapeRange.Top = ActiveSheet.Cells(srow, scol).Top
srow = srow + 1
End If
Next
End Sub