|
常用内置对话框参数解读-Excel VBA程序开发-ExcelHome技术论坛 - https://club.excelhome.net/forum ... amp;_dsign=c3dadaf0
- Sub ll()
- Dim Wk As Workbook
- Dim Sht As Worksheet
- Dim Rng As Range, oRng As Range
- Dim Str
- Windows("b.xlsm").Activate
- Set Rng = Selection
- Debug.Print Rng.Address
- Set Sht = Rng.Parent
- Set Wk = Sht.Parent
- Debug.Print Rng.Address, Rng.Parent.Name, Rng.Parent.Parent.Name
- Set oRng = Sht.Cells(1, "T")
- Debug.Print oRng.Address, oRng.Column, Rng.Address, Rng.Column
-
- Str = Wk.Name & "!" & Sht.Name & "!" & Rng(, oRng.Column - Rng.Column + 1).Resize(Rng.Rows.Count, 1).Address(0, 0)
- Debug.Print Str
- End Sub
复制代码 结果 --- b.xlsm!Sheet1!T14:T24
|
|