Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. Sheets("Menajeria offline").Activate
  2. If Range("E6") = "" Then
  3. MsgBox "pon tu nombre ya coach"
  4. Else
  5.  
  6. If Range("C10") = "" Then
  7. MsgBox "Por favor el mes ya coach"
  8. Else
  9.  
  10. Sheets("Sheet5").Activate
  11. For Each cell In Range("A2:O2")
  12. If cell.Value = "" Then
  13. count = count + 1
  14. End If
  15. Next
  16. If count > 0 Then
  17. MsgBox "Hay que rellenar todos los campos", vbInformation, "Error"
  18. Else
  19.  
  20. Sheets("Sheet5").Activate
  21. Range("A2").Select
  22. Range(Selection, Selection.End(xlToRight)).Select
  23. Selection.Copy
  24.  
  25. Sheets("Sheet5").Activate
  26.  
  27. file = Left(file, Position)
  28.  
  29. Set db = OpenDatabase(ThisWorkbook.Path & "Database1.mdb")
  30. ' open the database
  31. *Set rs = db.OpenRecordset("Tracker2", dbOpenTable)* (error here)
  32. ' get all records in a table
  33. r = 2 ' the start row in the worksheet
  34. Do While Len(Range("A" & r).Formula) > 0
  35. ' repeat until first empty cell in column A
  36. With rs
  37. .AddNew ' create a new record
  38. ' add values to each field in the record
  39. .Fields("User") = Range("A" & r).Text
  40. .Fields("Advisor Name") = Range("B" & r).Text
  41. .Fields("Email") = Range("C" & r).Text
  42. .Fields("Direct Manager") = Range("d" & r).Text
  43. .Fields("Manager E-mail") = Range("e" & r).Text
  44. .Fields("Quality coach") = Range("f" & r).Value
  45. .Fields("Date of Submission") = Range("g" & r).Text
  46. .Fields("Tipo de auditoria") = Range("h" & r).Text
  47. .Fields("Day") = Range("i" & r).Text
  48. .Fields("Month") = Range("j" & r).Text
  49. .Fields("Year") = Range("k" & r).Text
  50. .Fields("Número") = Range("l" & r).Text
  51. .Fields("Motivo de Contacto") = Range("m" & r).Text
  52. .Fields("Submotivo de Contacto") = Range("n" & r).Text
  53. .Fields("Saludo") = Range("o" & r).Text
  54. .Fields("Política de Seguridad") = Range("p" & r).Text
  55. .Fields("Resolución") = Range("Q" & r).Text
  56. .Fields("Seguir procedimiento") = Range("R" & r).Text
  57. .Fields("Nota") = Range("S" & r).Text
  58. .Fields("Tipificacion") = Range("T" & r).Text
  59. .Fields("Despedida") = Range("U" & r).Text
  60. .Fields("Ofrecer Alternativas") = Range("v" & r).Text
  61. .Fields("Seguimiento") = Range("w" & r).Text
  62. .Fields("Saludo razon ") = Range("x" & r).Text
  63. .Fields("Política de Seguridad razon") = Range("y" & r).Text
  64. .Fields("Resolución razon") = Range("z" & r).Text
  65. .Fields("Seguir procedimiento razon") = Range("aa" & r).Text
  66. .Fields("Nota razon") = Range("ab" & r).Text
  67. .Fields("Tipificacion razon") = Range("ac" & r).Text
  68. .Fields("Despedida razon") = Range("ad" & r).Text
  69. .Fields("Ofrecer Alternativas razon") = Range("ae" & r).Text
  70. .Fields("Seguimiento razon") = Range("af" & r).Text
  71. .Fields("Saludo comentario") = Range("ag" & r).Text
  72. .Fields("Política de Seguridad comentario") = Range("ah" & r).Text
  73. .Fields("Resolución comentario") = Range("ai" & r).Text
  74. .Fields("Seguir procedimiento comentario") = Range("aj" & r).Text
  75. .Fields("Nota comentario") = Range("ak" & r).Text
  76. .Fields("Tipificacion comentario") = Range("al" & r).Text
  77. .Fields("Despedida comentario") = Range("am" & r).Text
  78. .Fields("Ofrecer Alternativas comentario") = Range("an" & r).Text
  79. .Fields("Seguimiento comentario") = Range("ao" & r).Text
  80. .Fields("Explicacion/ comunicacion clara y efectiva") = Range("ap" & r).Text
  81. .Fields("Habilidades Comunicativas") = Range("aq" & r).Text
  82. .Fields("Ortografía y gramatica ") = Range("ar" & r).Text
  83. .Fields("Vodafone Marca Admirada") = Range("as" & r).Text
  84. .Fields("Explicacion/ comunicacion clara y efectiva razon 1") = Range("at" & r).Value
  85. .Fields("Explicacion/ comunicacion clara y efectiva razon 2") = Range("au" & r).Text
  86. .Fields("Explicacion/ comunicacion clara y efectiva razon 3") = Range("av" & r).Value
  87. .Fields("Explicacion/ comunicacion clara y efectiva razon 4") = Range("aw" & r).Value
  88. .Fields("Explicacion/ comunicacion clara y efectiva razon 5") = Range("ax" & r).Text
  89. .Fields("Habilidades Comunicativas razon 1") = Range("ay" & r).Text
  90. .Fields("Habilidades Comunicativas razon 2") = Range("az" & r).Text
  91. .Fields("Habilidades Comunicativas razon 3") = Range("ba" & r).Text
  92. .Fields("Habilidades Comunicativas razon 4") = Range("bb" & r).Text
  93. .Fields("Habilidades Comunicativas razon 5") = Range("bc" & r).Text
  94. .Fields("Ortografía y gramatica razon 1") = Range("bd" & r).Text
  95. .Fields("Ortografía y gramatica razon 2") = Range("be" & r).Text
  96. .Fields("Ortografía y gramatica razon 3") = Range("bf" & r).Text
  97. .Fields("Ortografía y gramatica razon 4") = Range("bg" & r).Text
  98. .Fields("Ortografía y gramatica razon 5") = Range("bh" & r).Text
  99. .Fields("Ortografía y gramatica razon 6") = Range("bi" & r).Text
  100. .Fields("Explicacion/ comunicacion clara y efectiva comentario") = Range("bj" & r).Text
  101. .Fields("Habilidades Comunicativas comentario") = Range("bk" & r).Text
  102. .Fields("Ortografía y gramatica comentario") = Range("bl" & r).Text
  103. .Fields("Vodafone Marca Admirada comentario") = Range("bm" & r).Text
  104. .Fields("Resumen del caso") = Range("bn" & r).Text
  105. .Fields("Customer obsessed") = Range("bo" & r).Text
  106. .Fields("Customer obsessed comentario") = Range("bp" & r).Text
  107. .Fields("Score") = Range("bq" & r).Text
  108. .Fields("Rate") = Range("br" & r).Text
  109. .Fields("Total Critical") = Range("bs" & r).Text
  110. .Fields("Total Non-Critical") = Range("bt" & r).Text
  111. ' add more fields if necessary...
  112. .Update ' stores the new record
  113. End With
  114. r = r + 1 ' next row
  115. Loop
  116. rs.Close
  117. Set rs = Nothing
  118. db.Close
  119. Set db = Nothing
  120.  
  121. Range("DO82") = ""
  122. End If
  123. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement