vba - Looping through each column of excel and dragging formula down by one cell each -


i'm new vba , know how stuff it. seen in table below, drag formula down 1 cell each column data expands on time. there quick , efficient way me loop through each column doing drag down action automatically?

example

code assumes formula in cell 2 of column

option explicit  sub autofill() dim rng range dim ws worksheet dim y  set ws = sheets("sheet1")  'range set rng = ws.range("a1:" & ws.range("a1").end(xltoright).address)  'looping each y in rng  'autofilling, note split function retreiving letter range    ws.range(split(cells(, y).address, "$")(1) & "2").autofill destination:=ws.range(split(cells(, y).address, "$")(1) & "2:" & split(cells(, y).address, "$")(1) & ws.range("a1").specialcells(xlcelltypelastcell).row) next y  end sub 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -