Re: $$Excel-Macros$$ '1004' Run Time Error when VBA Cell comment list is over 266 lines
Please verify the data on 266th row, with the data above 266 rows. Regards Eugene On Thu, Nov 7, 2013 at 1:59 AM, Denisetoo denise...@gmail.com wrote: 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 If -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups MS EXCEL AND VBA MACROS group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups MS EXCEL AND VBA MACROS group. To
Re: $$Excel-Macros$$ '1004' Run Time Error when VBA Cell comment list is over 266 lines
Thank you for your response Eugene. I have a fix that stops adding comments after 250 and mention in the comment section to list the 250 and mention there are too many to list. I appreciate your help. I will look at your suggestion and let you know. On Sat, Nov 16, 2013 at 8:02 AM, Eugene Bernard eugene.bern...@gmail.comwrote: Please verify the data on 266th row, with the data above 266 rows. Regards Eugene On Thu, Nov 7, 2013 at 1:59 AM, Denisetoo denise...@gmail.com wrote: 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 If -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups MS EXCEL AND VBA MACROS group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you