Hello!
For whatever reason I am having difficulty wrapping my head around how to write code to encompass a dynamic range. I've done some online searches but those codes never seemed to work.
A piece of code I am working on now came from Record Macro, but I need the Auto Fill to encompass B2 through an unknown column length instead of B2 through B26.
Using my example below, could someone please explain how to write this code process?
Thank you very much!!
For whatever reason I am having difficulty wrapping my head around how to write code to encompass a dynamic range. I've done some online searches but those codes never seemed to work.
A piece of code I am working on now came from Record Macro, but I need the Auto Fill to encompass B2 through an unknown column length instead of B2 through B26.
Using my example below, could someone please explain how to write this code process?
Code:
Range("B2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(INDEX('Query Results'!C[7],MATCH(Summary!RC[-1],'Query Results'!C[3],0)),"""")"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:B26")
Range("B2:B26").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Thank you very much!!
Last edited: