But I like doing things by programs more than by just doing them manually. Well, there are other languages I like better, easier to use and so forth. So we have to change it around a bit.įirst-I should have asked this before-is there a reason you want to do it in VBA? I have no objection, because I love VBA myself. But the code I gave you will update the row by two, rather than the column. Well, we can still do it, and it doesn't even have to be hard. Now I look again at your original post, and lo and behold, it says it's the column number you want to change! I could have sworn. Now, the next problem: I've been writing all along in the belief that you want to increment the reference's row number by two. But I'd say this is closer than you were. Now, I haven't tested this code, so there may still be syntax or other errors in there. Workbooks.Open ("H:\Desktop\Z1 assessment for CP data_v3.xlsx")Ĭo.Formula = Left(vf, pr - 1) & Mid(vf, pr) + 2ĪctiveWorkbook.SaveAs Filename:="1 " + ThisFileĮnd SubSelection, you see, is a collection of cells and when you do "For Each In ", it goes through the entire range, cell by cell for each cell it sets to that cell, then does the loop, then sets to the next cell, does the loop, and so on until it's done it to every cell in the Range.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |