Excel Macro Variable Named Ranges

%3CLINGO-SUB%20id%3D%22lingo-sub-1812312%22%20slang%3D%22en-US%22%3EExcel%20Macro%20Variable%20Named%20Ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1812312%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I'm%20new%20here%20and%20haven't%20found%20a%20thread%20quite%20like%20this%20one%2C%20so%20I%20hope%20I%20can%20get%20some%20help%20or%20be%20pointed%20in%20the%20general%20direction%20of%20where%20to%20go.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20a%20macro%20to%20add%20named%20ranges%20based%20on%20a%20change%20in%20a%20cell%20value%20and%20am%20really%20struggling%20to%20perform%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20data%20I'm%20working%20on%20is%20from%20an%20export%20from%20d365%20F%20%26amp%3B%20O%20so%20the%20data%20is%20variable%20in%20quantity%20each%20time%2C%20the%20data%20I%20also%20has%20doesn't%20have%20a%20primary%20key%20so%20I've%20added%20a%20formula%20which%20gives%20me%20the%20value%20in%20column%20a%20based%20on%20a%20change%20in%20a%20different%20column.%20I'd%20like%20to%20auto%20name%20range%20as%20detailed%20below%20and%20then%20be%20able%20to%20use%20those%20numbers%20to%20return%20results%20based%20on%20formulas%20utilising%20returns%20from%20a%20pivot%20table.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22excel%20macro%20required.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F228721iC3180A32F81612B8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22excel%20macro%20required.JPG%22%20alt%3D%22excel%20macro%20required.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Emany%20thanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESteve%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1812312%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20%26amp%3B%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

Hi, I'm new here and haven't found a thread quite like this one, so I hope I can get some help or be pointed in the general direction of where to go.

 

I am trying to create a macro to add named ranges based on a change in a cell value and am really struggling to perform this.

 

The data I'm working on is from an export from d365 F & O so the data is variable in quantity each time, the data I also has doesn't have a primary key so I've added a formula which gives me the value in column a based on a change in a different column. I'd like to auto name range as detailed below and then be able to use those numbers to return results based on formulas utilising returns from a pivot table.

excel macro required.JPG

 

many thanks

 

Steve

0 Replies