ScrollArea : How I can do that
Function AreaAddress(StartRow As Long, StartColumn As Long, _
RowOffset As Long, ColumnOffset As Long) As String
AreaAddress = Chr$(StartColumn + 64) & CStr(StartRow) & ":" & _
Chr$(StartColumn + ColumnOffset + 64) & _
CStr(StartRow + RowOffset)
End Function
Note: The function provides for both a row and column offset.
To use it, just pass the value you have and assign it directly. As per
your example...
J = 6 ' Start Row
K = 4 ' Start Column
X = 3 ' Row Offset
Y = 0 ' Column Offset
ActiveSheet.ScrollArea = AreaAddress(K, J, Y, X)
I made a last minute change in the order of the arguments and forgot to
update the above example. The last statement should be this instead of what
I posted originally...
ActiveSheet.ScrollArea = AreaAddress(J, K, X, Y)
Rick
|