4.5.5 利用Range引用外部数据
2015年09月17日 10:48 发布来源:Excel学习网
下面代码引用了名为“MyBook.xls”的工作簿中的名为“MyRange”的单元格区域:
Sub FormatRange()
Range("MyBook.xls!MyRange一).Font.Italic一True
End Sub
下面代码引用名为“Report.xls”工作薄中的特定工作表单元格区域“Sheetl!Sales":
Sub FormatSales()
Range《”[Report.xls)Sheetl!Sales一).BorderAround
End Sub
Weight:-xithin
若要选定命名区域,
了吧码如下:
Sub ClearRange()
请用GoTo方法,该方法将激活工作簿和工作表,然后选定该区域.
Application.Goto Reference:="MyBook.xls!MyRange"
Selection.ClearContents
End Sub
Sub FormatRange()
Range("MyBook.xls!MyRange一).Font.Italic一True
End Sub
下面代码引用名为“Report.xls”工作薄中的特定工作表单元格区域“Sheetl!Sales":
Sub FormatSales()
Range《”[Report.xls)Sheetl!Sales一).BorderAround
End Sub
Weight:-xithin
若要选定命名区域,
了吧码如下:
Sub ClearRange()
请用GoTo方法,该方法将激活工作簿和工作表,然后选定该区域.
Application.Goto Reference:="MyBook.xls!MyRange"
Selection.ClearContents
End Sub
![](http://www.excelxx.com/d/file/p/20150917/a63d75f3fe8de6769a195f50fa053bd3.gif)
相关教程:
经典Excel学习视频及教程推荐:
Excel优秀工具推荐:
小工具推荐: