|
楼主 |
发表于 2011-1-22 19:39
|
显示全部楼层
Sub Macro1()
'
' Macro1 Macro
'Union(Range("A1:H100").SpecialCells(xlCellTypeConstants, 23), Range("A1:H100").SpecialCells(xlCellTypeFormulas, 23)).Select
'n = Selection.Rows.Count
Dim introw As Double
introw = [a655536].End(xlUp).Row
ActiveCell.FormulaR1C1 = "=SUBSTITUTE(Sheet1!RC,CHAR(10),""&&"")"
Range("A1").Select
Selection.AutoFill Destination:=Range("A1:DZ1"), Type:=xlFillCopy
Range("A1:DZ1").Select
Selection.AutoFill Destination:=Range("A1:introw"), Type:=xlFillCopy
Range("A1:introw").Select
End Sub
我录制了一个宏,然后在里面加上了那个获取的最大行数,运行有错误,说 方法 RANGE 作用于_GLOBLE 时候失败。
是不是定义的变量要定义成全局的,或者代码要挪个位置,我现在看是在模块里面。 |
|