Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting Comment to Cell in Excel
#5
Hi Gintaras,
Thanks again for the Comment Insert function. Working more with the Excel function, I see the need for a function to convert column numbers (QM excel functions) to column names (for interaction with VB scripts refernces in QM). I looked around and found some examples on websites. I was able to almost convert one of the examples into QM but couldn't find a QM equivalent/import of Convert.ToChar

See examples at http://stackoverflow.com/questions/18159...lumn-eg-aa

Example code:
Code:
Copy      Help
private string GetExcelColumnName(int columnNumber)
{
    int dividend = columnNumber;
    string columnName = String.Empty;
    int modulo;

    while (dividend > 0)
    {
        modulo = (dividend - 1) % 26;
        columnName = Convert.ToChar(65 + modulo).ToString() + columnName;
        dividend = (int)((dividend - modulo) / 26);
    }

    return columnName;
}

Is this an easy thing to get into QM? This is not essential for my current project because I won't go beyond the first alphabet letters and I can manually map those but in the future, I can see the utility of this.

Thanks for any thoughts!
S


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)