如何selectexcel单元格只有字母表跟着?
我正在写的VBA脚本,select单元格范围在Excel表中,但它select在这种格式$ G $ 1:$ K $ 1,但我只需要这种格式$ G:$ K消除数字,而select或任何其他方法消除数字后面$ 。
Sub vloos() Dim rnge As Range Dim Rng As Range Dim user As String Dim file As String file = "E:\output4.xls" Workbooks.Add ActiveWorkbook.SaveAs file Set nb = Application.Workbooks.Open(file) Set ns = nb.Worksheets("Sheet1") 'get workbook path filename = Application.GetOpenFilename(FileFilter:="Excel Files (*.xlsx), *.xls", Title:="Please select a file") 'set our workbook and open it Set wb = Application.Workbooks.Open(filename) 'set our worksheet Set ws = wb.Worksheets("Sheet1") 'set the range for vlookup On Error GoTo En Set rnge = Application.InputBox(Prompt:="Range to format:", Title:="Format Range", Type:=8) Set Rng = ws.Range(rnge.Address) MsgBox Rng.Address En: End Sub
您可以使用Range
对象的EntireColumn
属性来获取列
On Error GoTo En Set rnge = Application.InputBox(Prompt:="Range to format:", Title:="Format Range", Type:=8) Set Rng = rnge.EntireColumn MsgBox Rng.Address
- Excel和Tableau不会将date维度检测为date时间列
- VBA ScreenUpdate和效率
- 带有小数的.NET OData错误:types不匹配
- 将一个OLE对象添加到属性失败,并显示“Win32 :: OLE(0.1709)错误0x80020003:PROPERTYPUTREF”
- Excel VBA – 以编程方式将代码插入到工作表的CodeModule中的特定子macros
- 将Excel工作表移动到使用VBA错误进行访问
- 用三个措施分组的Barplot
- EXCEL:VBA设置ActiveX组件不能为iMacro创build对象?
- 在Delphi 7中使用TExcelWorkBook SaveAs方法时出现Ole 800A03EC错误