vba Excel 宏 - 拍摄特定范围的快照

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14990503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 19:44:00  来源:igfitidea点击:

Excel Macro - Take a snapshot of Particular Range

excelvbaexcel-vba

提问by Tejas

I have come around a very strange requirement in my Excel Dashboard.

我在 Excel 仪表板中遇到了一个非常奇怪的要求。

I have a some data in a Range in a particular sheet. I need to take a snapshot of it and display it as an Image in all other sheets at top.

我在特定工作表的范围中有一些数据。我需要拍摄它的快照并将其显示为顶部所有其他工作表中的图像。

I know I can simply copy & paste the range but that kind of Header is creating some issues while hiding columns on the sheets.

我知道我可以简单地复制和粘贴范围,但是这种标题在隐藏工作表上的列时会产生一些问题。

Any solution/trick for that same?

任何解决方案/技巧?

回答by Tim Williams

Range has a .CopyPicture method.

Range 有一个 .CopyPicture 方法。

Or use the Camera tool:

或者使用相机工具:

Sub Tester() 
    Sheet1.Range("D5:E16").Copy 
    Sheet2.Activate
    Sheet2.Range("A1").Select 
    ActiveSheet.Pictures.Paste Link:=True 
    Application.CutCopyMode = False 
End Sub