VBA Code:
Sub demo()
Dim myRange As Range
Set myRange = Selection
myRange.Cells(1, 10).Select
ActiveCell.FormulaR1C1 = "=test" & "(RC[-9])"
Selection.AutoFill Destination:=Range("RC[-9]:RC" & Range("Selection" & Rows.count).End(xlUp).Row), Type:=xlFillDefault
End Sub
A | B | C | D | E | F | G | H | I | J |
Text1 | #VALUE! | ||||||||
Text2 | |||||||||
Text10 | |||||||||
Text1 |
Autofill in selection, selection is range("A1:A4") in this demo file.
range is selection like range("A1:A4") or may be any then enter formula which depending first cell of selection.Test is function formula.
but i want to autofill test function cell till last cell of selection row.
Is that possible?
Thanks