Johniny

Fill and Value except first cell

Mar 10th, 2020
566
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub FillNValue()
  2.  
  3. Dim toValRng As Range 'technically could be set to Object
  4. Dim toFillRng As Range
  5.  
  6. Set toFillRng = ThisWorkbook.Worksheets("FillDownM").Range("B2:B11") 'https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/creating-object-variables
  7. Set toValRng = ThisWorkbook.Worksheets("FillDownM").Range("B3:B11")
  8.  
  9. toFillRng.FillDown 'https://docs.microsoft.com/en-us/office/vba/api/excel.range.filldown
  10. toValRng.Formula = toValRng.Value
  11.  
  12. End Sub
RAW Paste Data