Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code seems limited by row number
Can any one explain to me why this code will not run on any row beyond row
99? I get the following error msg: "activecell row out of range or no list row selected" It works perfectly on row's 1 - 99. Private Sub CommandButton1_Click() Dim i As Long, nRow As Long, nLstIdx As Long Dim rngList As Range Dim aCols, aLstCols Application.ScreenUpdating = False aCols = Array(4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17, 18) '= destination column number aLstCols = Array(0, 4, 5, 13, 1, 6, 7, 14, 2, 8, 9, 15) ' = source column number Set rngList = Range(Me.ListBox1.RowSource) nRow = ActiveCell.Row nLstIdx = Me.ListBox1.ListIndex If nRow Me.ListBox1.ListCount Or nLstIdx = -1 Then MsgBox "activecell row out of range or no list row selected" Exit Sub End If For i = 0 To UBound(aCols) With Cells(nRow, aCols(i)) .Value = ListBox1.List(nLstIdx, aLstCols(i)) .Font.ColorIndex = rngList(nLstIdx + 1, aLstCols(i) + 1).Font.ColorIndex End With Next Application.ScreenUpdating = True Unload Tuesday_Route_To_Cover End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code seems limited by row number
to me the code works till the row of an active cell is not bigger than
the count of list elements |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
STDEV Limited Number of Arguments | Excel Worksheet Functions | |||
limited columns and rows number | New Users to Excel | |||
Copying over only limited number of characters | Excel Discussion (Misc queries) | |||
Number of dropdown fields in Excel is limited. I need more. How? | Excel Discussion (Misc queries) | |||
limited number of columns | Excel Discussion (Misc queries) |