Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA dropdownlist to put in cell's comment creates runtime error whenthe dropdownlist is above 266 lines

I get a run time "1004" when the comment lines are at 266 lines. WIth less than 200 comment lines the code runs fine. The DropDownTmp variable list includes all 266 lines. The comment field cuts off around 253 lines of code. The program stops with the run time error.

Any ideas on how to fix this?

SearchRowTemp = SearchRow
ErrorDesc = Sheets(SNLogNew).Cells(LogRowCounter, 1).Value & Sheets(SNLogNew).Cells(LogRowCounter, 2).Value
Do Until ErrorDesc = ""

If Left(ErrorDesc, 3) = " " Or Sheets(SNLogNew).Cells(LogRowCounter, 1).Value = "" Then
' Add a comment
If Not Found Then
If NewComment Then
Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).AddComment Text:=Trim(ErrorDesc)
Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).Comment..Shape.TextFrame.AutoSize = True
NewComment = False
Else
Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).Comment..Text Text:=Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).Comment.Text & Chr(10) & Trim(ErrorDesc)
End If
' Determine the number of specs in the drop down list
i_number_comments = Len(Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).Comment.Text) - Len(Replace(Sheets(SNTD).Cells(TDRowCounter _
- 1, Tdf_Col_Error).Comment.Text, Chr(10), ""))
Debug.Print i_number_comments
' If this is the last entry of a comment... add the data validation
If Left(ErrorDesc, 3) = " " And _
(Sheets(SNLogNew).Cells(LogRowCounter + 1, 1).Value = "" Or Left(Sheets(SNLogNew).Cells(LogRowCounter + 1, 1).Value, 3) < " ") And _
CMD_Tmp.DetailDropDown And TDRowCounter TDRow And i_number_comments 250 Then


DropDownTmp = Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Error).Comment.Text
' Add Drop Down Selection for "Detail" Cell
With Sheets(SNTD).Cells(TDRowCounter - 1, Tdf_Col_Detail).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=DropDownTmp
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With

End If

End IfShow trimmed content
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
Dropdownlist and Vlookup Mohamed72 Excel Discussion (Misc queries) 7 February 26th 13 09:18 AM
DropdownList/AutoFillUpList OssieMac Excel Discussion (Misc queries) 0 March 27th 07 11:58 PM
Aligment of DropDownList reloader[_2_] Excel Programming 0 March 30th 06 02:33 PM
Aligment of DropDownList reloader[_3_] Excel Programming 0 March 30th 06 02:31 PM
Dropdownlist in a Cell Lasse Matsson Excel Programming 1 September 26th 05 08:52 AM


All times are GMT +1. The time now is 02:42 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"