Kann mir dieses Verhalten jemand erklären?

  • Excel

Es gibt 20 Antworten in diesem Thema. Der letzte Beitrag () ist von bandchef.

    Kann mir dieses Verhalten jemand erklären?

    Hi Leute,

    ich hab wieder mal ein CodeProblem. Dieser Code macht folgendes. Das erste überprüft das Excelsheet um herauszufinden auf welcher Datenbank die Daten vom Excelsheet in die DB einzulesen sind.



    Visual Basic-Quellcode

    1. If Not ((xwsin.Cells(rowin, 2) = "") And (xwsin.Cells(rowin, 3) = "") _
    2. And (xwsin.Cells(rowin, 9) = Trim(xwsin.Cells(rowin, 9)))) Then
    3. 'Zweig für PM-Tabelle
    4. rsPM.AddNew
    5. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    6. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    7. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    8. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    9. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    10. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    11. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    12. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    13. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    14. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    15. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    16. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    17. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    18. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    19. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    20. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    21. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    22. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    23. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    24. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    25. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    26. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    27. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    28. rsPM.Update
    29. End If
    30. Else




    Wenn nun das Programm die Stelle mit rsPM.AddNew erreicht, bricht es genau dort ab und bringt mir diese Fehlermeldung: Laufzeitfehler '91' Objektvariable oder With-Blockvariable nicht festgelegt.

    Wisst ihr wo der Fehler liegt?

    Ich hab mir gedacht, dass es vielleicht hilft, wenn ich um rsPM.AddNew und rsPM.Update ein weitere If bastle, welche auf rsPM.RecordCount = 1 abfrägt; hat aber auch nichts geholfen; leider.

    Danke!


    Edit by Dodo:
    -> Topic verschoben (Gundlagen => VBA)

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Dodo“ ()

    rsPM hat diesen Datentyp DAO.Recordset und wurde nicht mit new intialisiert.

    Naja, ob ich wirklich in VB2008 programmiere, weiß ich ehrlich gesagt nicht. Ich hab mir nur gedacht, dass Excel 2007 vielleicht mi VB2008 arbeitet. Wissen tu ich es wirklich nicht. Welche Version benutze ich dann?

    bandchef schrieb:

    Welche Version benutze ich dann?
    Ich würde mal glatt behaupten: Deine.
    Warum machst Du zu ein und demselben Problem schon wieder einen neuen Thread auf :?:
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!

    RodFromGermany schrieb:

    bandchef schrieb:

    Welche Version benutze ich dann?
    Ich würde mal glatt behaupten: Deine.
    Warum machst Du zu ein und demselben Problem schon wieder einen neuen Thread auf :?:



    Ich entschuldige mich hierfür sehr höflich! Das war nicht beabsichtigt! Ich würde dich bitten, falls du Moderator bist, dass du meinen alten Thread löschst und diesen hier am Leben lässt.

    An alle anderen: Ich instanziiere dann rsPM mal mit new!

    BiedermannS schrieb:



    Datenbank sowie Recordset muss mit Set gesetzt werden
    SWYgeW91IGNhbiByZWFkIHRoaXMsIHlvdSdyZSBhIGdlZWsgOkQ=

    Weil einfach, einfach zu einfach ist! :D

    bandchef schrieb:

    Ich instanziiere dann rsPM mal mit new!

    Willst Du neue Tabelle erstellen oder auf eine vorhandene zugreifen?
    Ich vermute, die Zuweisung der Datenbank und Tabelle stimmt noch nicht.

    Visual Basic-Quellcode

    1. Dim db As Database
    2. Dim rs As DAO.Recordset
    3. Set db = DAO.OpenDatabase("Pfad\zu\datenbank.mdb")
    4. Set rs = db.OpenRecordset("TableName")
    5. rs.AddNew
    Ich habe nun den Code so verändert:



    Visual Basic-Quellcode

    1. Dim rsPM As DAO.Recordset
    2. Dim rsPMOver As DAO.Recordset
    3. Dim rsd As DAO.Recordset
    4. Dim dbPM As DAO.Database
    5. Dim dbPMOver As DAO.Database
    6. If Not ((xwsin.Cells(rowin, 2) = "") And (xwsin.Cells(rowin, 3) = "") _
    7. And (xwsin.Cells(rowin, 9) = Trim(xwsin.Cells(rowin, 9)))) Then
    8. 'Zweig für PM-Tabelle
    9. Set dbPM = CurrDB
    10. rsPM.AddNew
    11. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    12. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    13. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    14. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    15. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    16. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    17. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    18. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    19. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    20. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    21. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    22. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    23. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    24. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    25. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    26. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    27. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    28. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    29. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    30. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    31. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    32. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    33. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    34. rsPM.Update
    35. Else ...




    Leider geht das so auch nicht. Wie ich mit new Instanziiere weiß ich leider (noch) nicht.

    xtts02 schrieb:

    bandchef schrieb:

    Ich instanziiere dann rsPM mal mit new!

    Willst Du neue Tabelle erstellen oder auf eine vorhandene zugreifen?
    Ich vermute, die Zuweisung der Datenbank und Tabelle stimmt noch nicht.

    Visual Basic-Quellcode

    1. Dim db As Database
    2. Dim rs As DAO.Recordset
    3. Set db = DAO.OpenDatabase("Pfad\zu\datenbank.mdb")
    4. Set rs = db.OpenRecordset("TableName")
    5. rs.AddNew





    Ich hab dann nun den Code so geändert:

    Visual Basic-Quellcode

    1. Set rsPM = dbPM.OpenRecordset("PM")


    Leider geht das so aber auch nicht. Die Tabelle heißt einfach nur "PM".





    Nochmal was neues ausprobiert:

    Visual Basic-Quellcode

    1. Set dbPM = DAO.OpenDatabase
    2. Set rsPM = dbPM.OpenRecordset("PM")


    Geht aber auch nicht. Hier fällt mir das Programm gleich bei Set dbPM mit der Fehlermeldung "Argument ist nicht optional!" aus.

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „bandchef“ ()

    So sieht mein Code jetzt aus:

    Visual Basic-Quellcode

    1. If Not ((xwsin.Cells(rowin, 2) = "") And (xwsin.Cells(rowin, 3) = "") _
    2. And (xwsin.Cells(rowin, 9) = Trim(xwsin.Cells(rowin, 9)))) Then
    3. 'Zweig für PM-Tabelle
    4. Set dbPM = DAO.OpenDatabase
    5. Set rsPM = dbPM.OpenRecordset("PM")
    6. rsPM.AddNew
    7. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    8. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    9. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    10. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    11. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    12. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    13. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    14. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    15. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    16. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    17. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    18. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    19. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    20. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    21. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    22. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    23. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    24. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    25. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    26. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    27. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    28. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    29. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    30. rsPM.Update
    31. Else...
    Muss ich wirklich den Pfad zur Datei angeben? Ich im Programm einen Teil (der ist vorher) der mir Zeilen in der DB editiert. Hierzu muss ich auch auf die DB zugreifen und muss hierfür aber keine Pfad angeben. Dieser Teil funktioniert übrigens so wie er soll. Hier der Code vom funktionierenden Teil vom Programm der allerdings editiert und nicht eine neue Zeile hinzufügt:

    Visual Basic-Quellcode

    1. If Not ((xwsin.Cells(rowin, 2) <> "") And (xwsin.Cells(rowin, 3) <> "") _
    2. And (xwsin.Cells(rowin, 9) <> Trim(xwsin.Cells(rowin, 9)))) Then
    3. 'Zweig für PM-Tabelle
    4. ' rowNumber = xwsin.Cells(rowin - 2, 24)
    5. ' Set rsPM = CurrDB.OpenRecordset("Select * From PM Where RowAlt = " & rowNumber & " ;", dbOpenDynaset)
    6. rowNumberPM = xwsin.Cells(rowin - 2, 24) 'hier wird Zeilennummer aus Excel-Sheet herausgesucht
    7. Set rsPM = CurrDB.OpenRecordset("SELECT * FROM PM WHERE Row Like " & rowNumberPM & " ;", dbOpenDynaset)
    8. If rsPM.RecordCount = 1 Then
    9. rsPM.Edit
    10. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    11. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    12. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    13. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    14. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    15. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    16. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    17. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    18. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    19. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    20. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    21. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    22. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    23. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    24. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    25. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    26. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    27. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    28. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    29. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    30. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    31. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    32. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    33. rsPM.Update
    34. End If
    35. Else ...


    Edit: wenn ich den Pfad angebe, dann bekomm ich einen Laufzeitfehler, dass die Datenbank-Datei schon geöffnet sei...







    Ein weiteres Edit: Jetzt hab ich den Code weiter verändert und jetzt darf ich auf die DB auch ohne Pfad zugreifen. Dafür hab ich nun das Problem, dass ich rsPM.Update einen Laufzeitfehler 3058. Dieser besagt, dass "Null-Wert in Index- oder Primärschlüssel nicht möglich" seien.

    Visual Basic-Quellcode

    1. If Not ((xwsin.Cells(rowin, 2) = "") And (xwsin.Cells(rowin, 3) = "") _
    2. And (xwsin.Cells(rowin, 9) = Trim(xwsin.Cells(rowin, 9)))) Then
    3. 'Zweig für PM-Tabelle
    4. 'Set dbPM = DAO.OpenDatabase
    5. Set rsPM = CurrDB.OpenRecordset("PM")
    6. rsPM.AddNew
    7. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    8. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    9. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    10. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    11. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    12. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    13. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    14. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    15. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    16. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    17. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    18. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    19. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    20. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    21. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    22. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    23. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    24. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    25. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    26. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    27. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    28. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    29. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    30. If Cells(rowin, 24) = "1" Then rsPM!row = xwsin.Cells(rowin - 1, 24)
    31. rsPM.Update
    32. Else

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „bandchef“ ()

    bandchef schrieb:

    Set rsPM = CurrDB.OpenRecordset("SELECT * FROM PM WHERE Row Like " & rowNumberPM & " ;", dbOpenDynaset)


    Fällt dir was auf?
    SWYgeW91IGNhbiByZWFkIHRoaXMsIHlvdSdyZSBhIGdlZWsgOkQ=

    Weil einfach, einfach zu einfach ist! :D
    Ja, hier wird ja auch die Current Database, also die momentan schon benutzte Datenbank benutzt auf die mit einer SQL-Abfrage zugegriffen wird, verwendet.

    Ich hab meinen vorletzten Eintrag editiert! Vielleicht kannst du dir da das letzte Edit anschaun?

    Edit:

    Visual Basic-Quellcode

    1. If Not ((xwsin.Cells(rowin, 2) = "") And (xwsin.Cells(rowin, 3) = "") _
    2. And (xwsin.Cells(rowin, 9) = Trim(xwsin.Cells(rowin, 9)))) Then
    3. 'Zweig für PM-Tabelle
    4. Set rsPM = CurrDB.OpenRecordset("PM")
    5. rsPM.AddNew
    6. If Cells(rowin, 1) = "1" Then rsPM!ProjectManager = xwsin.Cells(rowin - 1, 1)
    7. If Cells(rowin, 2) = "1" Then rsPM!ProjectID = xwsin.Cells(rowin - 1, 2)
    8. If Cells(rowin, 3) = "1" Then rsPM!ProjectDescription = xwsin.Cells(rowin - 1, 3)
    9. If Cells(rowin, 4) = "1" Then rsPM!Type = xwsin.Cells(rowin - 1, 4)
    10. If Cells(rowin, 5) = "1" Then rsPM!ProductLine = xwsin.Cells(rowin - 1, 5)
    11. If Cells(rowin, 6) = "1" Then rsPM!SystemProject = xwsin.Cells(rowin - 1, 6)
    12. If Cells(rowin, 7) = "1" Then rsPM!SystemTxt = xwsin.Cells(rowin - 1, 7)
    13. If Cells(rowin, 8) = "1" Then rsPM!Location = xwsin.Cells(rowin - 1, 8)
    14. If Cells(rowin, 9) = "1" Then rsPM!EndDate = xwsin.Cells(rowin - 1, 9)
    15. If Cells(rowin, 10) = "1" Then rsPM!June2012 = xwsin.Cells(rowin - 1, 10)
    16. If Cells(rowin, 11) = "1" Then rsPM!July2012 = xwsin.Cells(rowin - 1, 11)
    17. If Cells(rowin, 12) = "1" Then rsPM!August2012 = xwsin.Cells(rowin - 1, 12)
    18. If Cells(rowin, 13) = "1" Then rsPM!September2012 = xwsin.Cells(rowin - 1, 13)
    19. If Cells(rowin, 14) = "1" Then rsPM!October2012 = xwsin.Cells(rowin - 1, 14)
    20. If Cells(rowin, 15) = "1" Then rsPM!November2012 = xwsin.Cells(rowin - 1, 15)
    21. If Cells(rowin, 16) = "1" Then rsPM!December2012 = xwsin.Cells(rowin - 1, 16)
    22. If Cells(rowin, 17) = "1" Then rsPM!January2013 = xwsin.Cells(rowin - 1, 17)
    23. If Cells(rowin, 18) = "1" Then rsPM!February2013 = xwsin.Cells(rowin - 1, 18)
    24. If Cells(rowin, 19) = "1" Then rsPM!March2012 = xwsin.Cells(rowin - 1, 19)
    25. If Cells(rowin, 20) = "1" Then rsPM!April2013 = xwsin.Cells(rowin - 1, 20)
    26. If Cells(rowin, 21) = "1" Then rsPM!May2013 = xwsin.Cells(rowin - 1, 21)
    27. If Cells(rowin, 22) = "1" Then rsPM!June2013 = xwsin.Cells(rowin - 1, 22)
    28. If Cells(rowin, 23) = "1" Then rsPM!PREMail = xwsin.Cells(rowin - 1, 23)
    29. If Cells(rowin, 24) = "1" Then rsPM!row = xwsin.Cells(rowin - 1, 24)
    30. rsPM.Update
    31. Else




    So geht's jetzt übrigens :)

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „bandchef“ ()