excel - Vba fail to name cell in macro -
I try cell names with macros in Excel. Here is the code: Header () set workbook as a slow workbook diminished in the form of a diminished range of worksheet dim cell as integer dim j as intensive dim Integer Dim L as integer I = 0 J = 0 K = 0 l = 0 Range in the form of dim column range as range dim range set as MyCellRange range MyColumnRange = ActiveSheet.Range ("E7: V8") Set MyRowRange = ActiveSheet.Range ("B10: B16") Set MyCellRange = ActiveSheet.Range ("E10: V16") Dim MyColumnNa Me string string MyRowName string as MyCellName String MyColumnName = "HC_" MyRowName = "HL_" MyCellName = "?" In the MyRowRange cell for each cell Name = MyRowName + CStr (j) j = j + 1 if not in MyColumnRange for each cell (cell value) then cell. Name = MyColumnName + CStr (i) i = i + 1 end if the next cell for each cell in the MyCellRange cell. Name = MyRowName + CStr (k) + MyCellName + MyColumnName + CStr (l) if l = (MyCellRange.Column.Count- 1) then l = 0 k = k + 1 Else l = l + 1 End if the next cell & sub I work well for naming in MyColumnRange and MyCellRange , but for MyRowRange I have an error
"method name of object series failed"
and I do not understand why
When you name the cells in MyRowRange:
MyRowRange for each cell In el. Name = MyRowName + CStr (i) j = j + 1 next cell You are giving them names with your designated variable i but you can name many variables Increasing j might mean you mean cell. Name = Myrov name + sist (j)
Comments
Post a Comment