I have this code below. this code creates named range for columns that are selected meaning on selection.
but the selection has one big problem. if you select columns that are next to eachother then it works.
but if the you select non-adjacent columns then VBA only creates named range first one and ignores all other selected columns.
in this attached example. i selected column B and column Dthen, i run the macro. it should have 4 named ranges. two helper named ranges Sheet1 =Sheet1!$1:$1048576 and Sheet1Lrow = =LOOKUP(9.99999999999999E+307,1/(1-ISBLANK(Sheet1!$A:$A)),ROW(Sheet1!$A:$A)) up to here it works fine. but then it also should create two named ranges one of column B "Sheet1Month" and another named range from column D "Sheet1Amount" becuase i selected two columns.
the macro is currently crearting 3 named ranges and it misses the other column D.
i have uploaded the sample file in this thread. I also recorded a few second video that shows the problem link of video in dropbox https://www.dropbox.com/s/1dviz5e9s3...Video.mp4?dl=0 i could not upload mp4 file here, so i used dropbox.
i would greatly appreciate any help. I spent hours and i could not find a solution. I hope one of you geniuses could help me find the solution.
Thank you very much.
![]()
Please Login or Register to view this content.
Bookmarks