Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofill cells below

Status
Not open for further replies.

mahsun

Technical User
Dec 30, 2010
2
NL

Dear people,

My macro is almost finished , but i need to autofill the cells below, till row next to it is empty. Is there somebody who knows how to do this. Below is my macro, I placed dots were I need the missing codes.
Thank you in advance
Mahsun





Sub deelC2()
'
' deelC2 Macro
'

'
Range("A1").Select
Cells.Find(What:= _
"#rewto" _
, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) _
.Activate
Selection.Offset(4, 6) = "=INDEX(R4C44:R6172C48,MATCH(RC[-1],R4C4:R6172C4,0),5)"
ActiveCell.Select
.....


End Sub
 
Solved!!

Sub deelC2()

Dim R As Range
Dim Limit As Long
Set R = Cells.Find(What:="# 11 Closing weight in percentage closing_weight N 18 13", After:=Range("A1"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Offset(4, 6)
R.FormulaR1C1 = "=INDEX(R4C44:R6172C48,MATCH(RC[-1],R4C4:R6172C4,0),5)"
Limit = Cells(R.Row, R.Column - 1).End(xlDown).Row
R.AutoFill Range(Cells(R.Row, R.Column), Cells(Limit, R.Column))

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top