所以我想要做的是通過無論底部#是爲了我的列表1。在這樣做的過程中,我正在將所有信息都移到正確的位置。然後,我將進入我選擇的底部,在列B中查找列表的底部,然後保留1,以查找填充#系統底部A列到底部列表的底部。我該如何設置「Dim y As」?
Private Sub CommandButton2_Click()
'My problem is i don't know what to set "Dim y As Range" I know Range is
'incorrect along with Long, and Integer.
Dim y As Range
Sheets("PalmFamily").Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select
ActiveCell.FormulaR1C1 = "2"
Range("A3").Select
ActiveCell.FormulaR1C1 = "3"
Range("A1:A3").Select
'As you can notice I also have a weird code
'" y = Range("B1").End(xlDown).Offset(0, -1)" I'm trying to go to the bottom
'of my list then move left 1.
y = Range("B1").End(xlDown).Offset(0, -1)
'As well the I'm not sure if I set my range to be correct when I do
'"Range("A1,y")"
Selection.AutoFill Destination:=Range("A1,y"), Type:=xlFillDefault
Range("A1,y").Select
End Sub
此代碼不會編譯。 –