看板 Visual_Basic 關於我們 聯絡資訊
想請問一下板上的大大們 關於自動填滿 可用下列的code selection.autofill destination : = range("L2:L"& [L2].currentRegion.Rows.Count ) 但若不一定是L2要往下填滿呢 小妹想寫的自動化 是會從A2 到最右 再向右位移1 位移完的cell 會貼上公式 然後會想要往下填滿 所以變成下次做是M 下下次N 想要讓以上code可以變成變動欄位 但我自己試了幾次都找不到方向。。 資料也找不到 不知道有沒有人會。。。。 謝謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.136.133.20 ※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1489132362.A.F76.html
MOONRAKER: What does "從A2到最右 再向右位移1" mean03/10 16:58
Range("A2").select selection.end(xltoright).select activecell.offset(0,1).select 然後貼上公式 activesheet.paste 再接 selection.autofill destination : = range("L2:L"& [L2].currentRegion.Rows.Count ) 但這樣每次都會是L2往下填滿。。。 ※ 編輯: hsin60832 (114.136.133.20), 03/10/2017 19:37:04