פורסם 2007 ביוני 1218 שנים שלום לכולםהחלטתי להתנסות בכתיבת קוד עבור מאקרו לאקסלאני מקבל ERROR 1004Application defined or object defined errorבאקסל הוא פותח לי חלון שגיאה עם המספר 400 הרי הקוד :Sub Compare_lotto_numbers() Dim i1, i2, i3, i4 As Integer Dim IND, IND3, IND4, IND5, IND6, RF As Integer Dim IntRowCount As Integer Dim Temp(6) As Integer IntRowCount = Range("A2").CurrentRegion.Rows.Count - 1 For i1 = 1 To IntRowCount i3 = 1 For i3 = 1 To IntRowCount If ActiveCell.Offset(0, -11).Value < i3 Then RF = ActiveCell.Offset(0, -11).Value - i3 Else RF = i3 - ActiveCell.Offset(0, -11).Value End If i4 = 1 For i4 = 1 To 6 Temp(i4) = ActiveCell.Offset(0, i4 - 9).Value i2 = 1 For i2 = 1 To 6 If Temp(i4) = ActiveCell.Offset(RF, i2 - 9).Value Then IND = IND + 1 End If Next i2 If IND = 3 Then IND3 = IND3 + 1 If IND = 4 Then IND4 = IND4 + 1 If IND = 5 Then IND3 = IND5 + 1 If IND = 6 Then IND6 = IND6 + 1 IND = 0 Next i4 Next i3 ActiveCell.Value = IND3 ActiveCell.Offset(0, 1).Value = IND4 ActiveCell.Offset(0, 2).Value = IND5 ActiveCell.Offset(0, 3).Value = IND6 - 1 ActiveCell.Offset(1, 0).Select Next i1End Subתודה מראש
פורסם 2007 ביוני 1218 שנים על איזו שורה , ואם אין לך מספיק מידע על השגיאה אז שים on error goto ותדפיס את הערך Err.Description
פורסם 2007 ביוני 1318 שנים מחבר תיקנתי את הגיאותאך עדיין יש לי בעיה אחתאני רוצה להשתמש ה Activecell.offset עם משתנים בתוכו ולא עם ערכים האם הדבר אפשרי או צריך לעשות זאת בדרך אחרת ?תודה
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.