Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
STDEV Limited Number of Arguments nc_pinz Excel Worksheet Functions 1 September 15th 09 07:54 PM
limited columns and rows number Aline New Users to Excel 2 December 20th 07 07:19 PM
Copying over only limited number of characters phuser Excel Discussion (Misc queries) 2 November 8th 06 10:05 PM
Number of dropdown fields in Excel is limited. I need more. How? UweVahrson Excel Discussion (Misc queries) 7 March 28th 05 05:10 PM
limited number of columns Katja Excel Discussion (Misc queries) 0 February 5th 05 03:21 PM


All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"