Hi,
This was a bit hard to follow, I recommend using a little more descriptive variable names in the future. That being said, in looking at it, when you first use the variable "m" you are using it as the index of the current column. But when you call SelectCell on the last line you are using it as part of the row arg instead of the column arg. SelectCell has two arguments, objRow, objColumn. objRow can be either a numeric or a string. If objRow is a numeric it represents the index of a row on the root band. If objRow is a string, it's a little more complex, but mostly it represents bands and rows, but you are passing in an index of a column, since it's a number, sometimes it may return a valid value, but on a whole it will likely not work as expected.
I am guessing you are looking to SelectCell i, m, but I am not sure what the value "dbvalue" represents, is that supposed to be the column key, or are you trying to set it to the value "dbvalue", in which case I think you want to use SetCellData.
As to how to use the objRow as a string. It is typically used only for hierarchical grids, in which case its a semi-colon separated list of row numbers, starting from the first number being the row on the root band, then continues down that row's child band row number on, repeating on down until it gets to the actual row. It adds a little bit more complexity in that you can have sibling child bands, so that an individual row can have multiple separate bands directly under it, in which case that section of semi-colon separated values is also comma separated, with the first number being the child band index, and the second number being the row number.
That being said when you used SelectCell "i;m", "dbvalue" it translated it as Select the cell of root band row index i's child row index m with a column key of "dbvalue". Which can in theory exist, but will likely fail.
I hope this helps,