Following is my vba code,where i`m trying to get data and assign it to a cell.Now,all I need to do is to lock these cells after filling. And there are many cells where I have to do this, all I got is 'qa' part is same in all the cell names I have to fill.So I have to check if 'qa' is part of the cell name,if yes then lock that complete cell and change the color.
ActiveWorkbook.Names("Book.aa.a.qa.qq.le.").RefersToRange = Doc.getAttribute("le")
ActiveWorkbook.Names("Book.bb.a.qa.qq.lf.").RefersToRange = Doc.getAttribute("lf")
ActiveWorkbook.Names("Book.cc.a.qa.qq.lg.").RefersToRange = Doc.getAttribute("lg")
ActiveWorkbook.Names("Book.dd.a.qa.qq.ll.").RefersToRange = Doc.getAttribute("ll")
How to do this? Please suggest a function for this. Thanks in advance.