Re: [RESOLVED] Need Advice
Rows start at .FixedRow, columns start at .FixedCol. That way the code is correct regardless of how many fixed rows or columns you have. (Absolute rows and columns start at 0.)
The entire selected area can be returned with .Row and .RowSel. The inner loop will return just the current row. I don't think there's a property to return a row.
Code:
For i = .Row To .RowSel
For j = .FixedCols To .Cols - 1
strRow = strRow & .TextMatrix(i, j) [COLOR="Green"]
If j < .Cols - 1 Then strRow = strRow & vbTab
Next j
strRow = strRow & vbNewLine
Next i
And good catch on my premature For exit.
Re: [RESOLVED] Need Advice
Quote:
Originally Posted by Al42
Rows start at .FixedRow, columns start at .FixedCol. That way the code is correct regardless of how many fixed rows or columns you have. (Absolute rows and columns start at 0.)
I'm slow on the uptake today. Would you mind elaborating on this?
I'm not sure I understand what a fixed row/column even is.
Re: [RESOLVED] Need Advice
They are headers (either at the top of the grid, or on the left) that don't contain data, and don't scroll (hence 'fixed').
As the first row/column is 0, the number of fixed rows/columns (returned by .FixedRows/.FixedCols ) is always equal to the first 'data' row/column.
eg: if the number of fixed rows is 1, then row(0) will be the header, and row(1) is the first row of data.