elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Foros Generales
| |-+  Dudas Generales (Moderador: engel lex)
| | |-+  Ayuda con VBA en excel :c
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda con VBA en excel :c  (Leído 1,671 veces)
emmalml

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Ayuda con VBA en excel :c
« en: 5 Noviembre 2018, 15:54 pm »

Resulta que me manda un error al momento de hace la macro en excel y no tengo ni idea de porque. este es el codigo, espero puedan ayudarme.
Código
  1. Sub Tabla()
  2. '
  3. ' Tabla Macro
  4. ' muestra la tabla de amortizaciones
  5. '
  6.  
  7. '
  8.    Application.ScreenUpdating = False
  9.    Range("C23").Select
  10.    ActiveCell.FormulaR1C1 = "1"
  11.    Range("C24").Select
  12.    ActiveCell.FormulaR1C1 = "=IFERROR(IF(R14C7=R[-1]C,"""",R[-1]C+1),"""")"
  13.    Range("C24").Select
  14.    Selection.Copy
  15.    Range(Selection, Selection.End(xlDown)).Select
  16.    ActiveSheet.Paste
  17.    Range("E23").Select
  18.    Application.CutCopyMode = False
  19.    ActiveCell.FormulaR1C1 = "=IF(RC[-2]="""","""",-PMT(R8C7,R14C7,R4C7))"
  20.    Range("E24").Select
  21.    ActiveCell.FormulaR1C1 = "=IF(RC[-2]="""","""",-PMT(R8C7,R14C7,R4C7))"
  22.    Range("E24").Select
  23.    Selection.Copy
  24.    Range(Selection, Selection.End(xlDown)).Select
  25.    Application.CutCopyMode = False
  26.    ActiveSheet.Paste
  27.    Range(Selection, Selection.End(xlUp)).Select
  28.    Range("I27").Select
  29.    ActiveCell.FormulaR1C1 = ""
  30.    Range("G29").Select
  31.    ActiveCell.FormulaR1C1 = ""
  32.    Range("E23:K24").Select
  33.    Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
  34.    Selection.NumberFormat = _
  35.        "_-[$$-es-MX]* #,##0.00_-;-[$$-es-MX]* #,##0.00_-;_-[$$-es-MX]* ""-""??_-;_-@_-"
  36.    Range("E24").Select
  37.    Selection.Copy
  38.    Range("G26").Select
  39.    Application.CutCopyMode = False
  40.    ActiveCell.FormulaR1C1 = ""
  41.    Range("E24").Select
  42.    Selection.Copy
  43.    Range(Selection, Selection.End(xlDown)).Select
  44.    ActiveSheet.Paste
  45.    Range("G25").Select
  46.    Application.CutCopyMode = False
  47.    ActiveCell.FormulaR1C1 = ""
  48.    Range("G23").Select
  49.    ActiveCell.FormulaR1C1 = "=-IPMT(R8C7,RC[-4],R14C7,R4C7)"
  50.    Range("I23").Select
  51.    ActiveCell.FormulaR1C1 = "=RC[-4]-RC[-2]"
  52.    Range("K23").Select
  53.    ActiveCell.FormulaR1C1 = "=R4C7-RC[-2]"
  54.    Range("G24").Select
  55.    ActiveCell.FormulaR1C1 = _
  56.        "=IFERROR(IF(R14C7=R[-1]C[-4],"""",-IPMT(R8C7,RC[-4],R14C7,R4C7)),"""")"
  57.    Range("I24").Select
  58.    ActiveCell.FormulaR1C1 = _
  59.        "=IFERROR(IF(R14C7=R[-1]C[-6],"""",RC[-4]-RC[-2]),"""")"
  60.    Range("K24").Select
  61.    ActiveCell.FormulaR1C1 = _
  62.        "=IFERROR(IF(R14C7=R[-1]C[-8],"""",R[-1]C-RC[-2]),"""")"
  63.    Range("G24").Select
  64.    Selection.Copy
  65.    Range(Selection, Selection.End(xlDown)).Select
  66.    ActiveSheet.Paste
  67.    Range("I24").Select
  68.    Application.CutCopyMode = False
  69.    ActiveCell.FormulaR1C1 = _
  70.        "=IFERROR(IF(R14C7=R[-1]C[-6],"""",RC[-4]-RC[-2]),"""")"
  71.    Range("I24").Select
  72.    Selection.Copy
  73.    Range(Selection, Selection.End(xlDown)).Select
  74.    ActiveSheet.Paste
  75.    Range("K26").Select
  76.    Application.CutCopyMode = False
  77.    ActiveCell.FormulaR1C1 = ""
  78.    Range("K24").Select
  79.    Selection.Copy
  80.    Range(Selection, Selection.End(xlDown)).Select
  81.    ActiveSheet.Paste
  82.    Range("M26").Select
  83.    Application.CutCopyMode = False
  84.    ActiveCell.FormulaR1C1 = ""
  85.    Range("M24").Select
  86.    Range(Selection, Selection.End(xlDown)).Select
  87.    Range("C1048576").Select
  88.    Range(Selection, Selection.End(xlUp)).Select
  89.    Range("C22,E22,G22,I22,K22").Select
  90.    Range("K22").Activate
  91.    With Selection.Interior
  92.        .Pattern = xlSolid
  93.        .PatternColorIndex = xlAutomatic
  94.        .Color = 8420607
  95.        .TintAndShade = 0
  96.        .PatternTintAndShade = 0
  97.    End With
  98.    With Selection
  99.        .HorizontalAlignment = xlCenter
  100.        .VerticalAlignment = xlTop
  101.        .WrapText = False
  102.        .Orientation = 0
  103.        .AddIndent = False
  104.        .IndentLevel = 0
  105.        .ShrinkToFit = False
  106.        .ReadingOrder = xlContext
  107.        .MergeCells = False
  108.    End With
  109.    With Selection
  110.        .HorizontalAlignment = xlCenter
  111.        .VerticalAlignment = xlCenter
  112.        .WrapText = False
  113.        .Orientation = 0
  114.        .AddIndent = False
  115.        .IndentLevel = 0
  116.        .ShrinkToFit = False
  117.        .ReadingOrder = xlContext
  118.        .MergeCells = False
  119.    End With
  120.    With Selection
  121.        .HorizontalAlignment = xlLeft
  122.        .VerticalAlignment = xlCenter
  123.        .WrapText = False
  124.        .Orientation = 0
  125.        .AddIndent = False
  126.        .IndentLevel = 0
  127.        .ShrinkToFit = False
  128.        .ReadingOrder = xlContext
  129.        .MergeCells = False
  130.    End With
  131.    With Selection
  132.        .HorizontalAlignment = xlCenter
  133.        .VerticalAlignment = xlCenter
  134.        .WrapText = False
  135.        .Orientation = 0
  136.        .AddIndent = False
  137.        .IndentLevel = 0
  138.        .ShrinkToFit = False
  139.        .ReadingOrder = xlContext
  140.        .MergeCells = False
  141.    End With
  142.    Range("C22").Select
  143.    ActiveCell.FormulaR1C1 = "NO. DE PAGO"
  144.    Range("E22").Select
  145.    ActiveCell.FormulaR1C1 = "PAGO"
  146.    Range("C22").Select
  147.    ActiveCell.FormulaR1C1 = "NO. DE PAGO"
  148.    Range("G22").Select
  149.    ActiveCell.FormulaR1C1 = "INTERESES"
  150.    Range("I22").Select
  151.    ActiveCell.FormulaR1C1 = "CAPITAL"
  152.    Range("K22").Select
  153.    ActiveCell.FormulaR1C1 = "RESTO"
  154.    Range("C22").Select
  155.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  156.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  157.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  158.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  159.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  160.    With Selection.Borders(xlEdgeRight)
  161.        .LineStyle = xlDash
  162.        .ColorIndex = 0
  163.        .TintAndShade = 0
  164.        .Weight = xlMedium
  165.    End With
  166.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  167.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  168.    Range("C21").Select
  169.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  170.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  171.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  172.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  173.    With Selection.Borders(xlEdgeBottom)
  174.        .LineStyle = xlDash
  175.        .ColorIndex = 0
  176.        .TintAndShade = 0
  177.        .Weight = xlMedium
  178.    End With
  179.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  180.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  181.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  182.    ActiveWindow.ScrollRow = 1
  183.    Range("B22").Select
  184.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  185.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  186.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  187.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  188.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  189.    With Selection.Borders(xlEdgeRight)
  190.        .LineStyle = xlDash
  191.        .ColorIndex = 0
  192.        .TintAndShade = 0
  193.        .Weight = xlMedium
  194.    End With
  195.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  196.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  197.    Range("C22").Select
  198.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  199.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  200.    With Selection.Borders(xlEdgeLeft)
  201.        .LineStyle = xlDash
  202.        .ColorIndex = 0
  203.        .TintAndShade = 0
  204.        .Weight = xlMedium
  205.    End With
  206.    With Selection.Borders(xlEdgeTop)
  207.        .LineStyle = xlDash
  208.        .ColorIndex = 0
  209.        .TintAndShade = 0
  210.        .Weight = xlMedium
  211.    End With
  212.    With Selection.Borders(xlEdgeBottom)
  213.        .LineStyle = xlDash
  214.        .ColorIndex = 0
  215.        .TintAndShade = 0
  216.        .Weight = xlMedium
  217.    End With
  218.    With Selection.Borders(xlEdgeRight)
  219.        .LineStyle = xlDash
  220.        .ColorIndex = 0
  221.        .TintAndShade = 0
  222.        .Weight = xlMedium
  223.    End With
  224.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  225.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  226.    Range("E21").Select
  227.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  228.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  229.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  230.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  231.    With Selection.Borders(xlEdgeBottom)
  232.        .LineStyle = xlDash
  233.        .ColorIndex = 0
  234.        .TintAndShade = 0
  235.        .Weight = xlMedium
  236.    End With
  237.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  238.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  239.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  240.    Range("D22").Select
  241.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  242.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  243.    With Selection.Borders(xlEdgeLeft)
  244.        .LineStyle = xlDash
  245.        .ColorIndex = 0
  246.        .TintAndShade = 0
  247.        .Weight = xlMedium
  248.    End With
  249.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  250.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  251.    With Selection.Borders(xlEdgeRight)
  252.        .LineStyle = xlDash
  253.        .ColorIndex = 0
  254.        .TintAndShade = 0
  255.        .Weight = xlMedium
  256.    End With
  257.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  258.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  259.    Range("E22").Select
  260.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  261.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  262.    With Selection.Borders(xlEdgeLeft)
  263.        .LineStyle = xlDash
  264.        .ColorIndex = 0
  265.        .TintAndShade = 0
  266.        .Weight = xlMedium
  267.    End With
  268.    With Selection.Borders(xlEdgeTop)
  269.        .LineStyle = xlDash
  270.        .ColorIndex = 0
  271.        .TintAndShade = 0
  272.        .Weight = xlMedium
  273.    End With
  274.    With Selection.Borders(xlEdgeBottom)
  275.        .LineStyle = xlDash
  276.        .ColorIndex = 0
  277.        .TintAndShade = 0
  278.        .Weight = xlMedium
  279.    End With
  280.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  281.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  282.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  283.    Range("E22").Select
  284.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  285.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  286.    With Selection.Borders(xlEdgeLeft)
  287.        .LineStyle = xlDash
  288.        .ColorIndex = 0
  289.        .TintAndShade = 0
  290.        .Weight = xlMedium
  291.    End With
  292.    With Selection.Borders(xlEdgeTop)
  293.        .LineStyle = xlDash
  294.        .ColorIndex = 0
  295.        .TintAndShade = 0
  296.        .Weight = xlMedium
  297.    End With
  298.    With Selection.Borders(xlEdgeBottom)
  299.        .LineStyle = xlDash
  300.        .ColorIndex = 0
  301.        .TintAndShade = 0
  302.        .Weight = xlMedium
  303.    End With
  304.    With Selection.Borders(xlEdgeRight)
  305.        .LineStyle = xlDash
  306.        .ColorIndex = 0
  307.        .TintAndShade = 0
  308.        .Weight = xlMedium
  309.    End With
  310.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  311.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  312.    Range("F22").Select
  313.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  314.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  315.    With Selection.Borders(xlEdgeLeft)
  316.        .LineStyle = xlDash
  317.        .ColorIndex = 0
  318.        .TintAndShade = 0
  319.        .Weight = xlMedium
  320.    End With
  321.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  322.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  323.    With Selection.Borders(xlEdgeRight)
  324.        .LineStyle = xlDash
  325.        .ColorIndex = 0
  326.        .TintAndShade = 0
  327.        .Weight = xlMedium
  328.    End With
  329.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  330.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  331.    Range("G21").Select
  332.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  333.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  334.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  335.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  336.    With Selection.Borders(xlEdgeBottom)
  337.        .LineStyle = xlDash
  338.        .ColorIndex = 0
  339.        .TintAndShade = 0
  340.        .Weight = xlMedium
  341.    End With
  342.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  343.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  344.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  345.    Range("G22").Select
  346.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  347.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  348.    With Selection.Borders(xlEdgeLeft)
  349.        .LineStyle = xlDash
  350.        .ColorIndex = 0
  351.        .TintAndShade = 0
  352.        .Weight = xlMedium
  353.    End With
  354.    With Selection.Borders(xlEdgeTop)
  355.        .LineStyle = xlDash
  356.        .ColorIndex = 0
  357.        .TintAndShade = 0
  358.        .Weight = xlMedium
  359.    End With
  360.    With Selection.Borders(xlEdgeBottom)
  361.        .LineStyle = xlDash
  362.        .ColorIndex = 0
  363.        .TintAndShade = 0
  364.        .Weight = xlMedium
  365.    End With
  366.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  367.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  368.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  369.    Range("G22").Select
  370.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  371.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  372.    With Selection.Borders(xlEdgeLeft)
  373.        .LineStyle = xlDash
  374.        .ColorIndex = 0
  375.        .TintAndShade = 0
  376.        .Weight = xlMedium
  377.    End With
  378.    With Selection.Borders(xlEdgeTop)
  379.        .LineStyle = xlDash
  380.        .ColorIndex = 0
  381.        .TintAndShade = 0
  382.        .Weight = xlMedium
  383.    End With
  384.    With Selection.Borders(xlEdgeBottom)
  385.        .LineStyle = xlDash
  386.        .ColorIndex = 0
  387.        .TintAndShade = 0
  388.        .Weight = xlMedium
  389.    End With
  390.    With Selection.Borders(xlEdgeRight)
  391.        .LineStyle = xlDash
  392.        .ColorIndex = 0
  393.        .TintAndShade = 0
  394.        .Weight = xlMedium
  395.    End With
  396.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  397.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  398.    Range("H22").Select
  399.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  400.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  401.    With Selection.Borders(xlEdgeLeft)
  402.        .LineStyle = xlDash
  403.        .ColorIndex = 0
  404.        .TintAndShade = 0
  405.        .Weight = xlMedium
  406.    End With
  407.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  408.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  409.    With Selection.Borders(xlEdgeRight)
  410.        .LineStyle = xlDash
  411.        .ColorIndex = 0
  412.        .TintAndShade = 0
  413.        .Weight = xlMedium
  414.    End With
  415.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  416.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  417.    Range("I21").Select
  418.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  419.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  420.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  421.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  422.    With Selection.Borders(xlEdgeBottom)
  423.        .LineStyle = xlDash
  424.        .ColorIndex = 0
  425.        .TintAndShade = 0
  426.        .Weight = xlMedium
  427.    End With
  428.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  429.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  430.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  431.    Range("I22").Select
  432.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  433.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  434.    With Selection.Borders(xlEdgeLeft)
  435.        .LineStyle = xlDash
  436.        .ColorIndex = 0
  437.        .TintAndShade = 0
  438.        .Weight = xlMedium
  439.    End With
  440.    With Selection.Borders(xlEdgeTop)
  441.        .LineStyle = xlDash
  442.        .ColorIndex = 0
  443.        .TintAndShade = 0
  444.        .Weight = xlMedium
  445.    End With
  446.    With Selection.Borders(xlEdgeBottom)
  447.        .LineStyle = xlDash
  448.        .ColorIndex = 0
  449.        .TintAndShade = 0
  450.        .Weight = xlMedium
  451.    End With
  452.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  453.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  454.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  455.    Range("I22").Select
  456.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  457.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  458.    With Selection.Borders(xlEdgeLeft)
  459.        .LineStyle = xlDash
  460.        .ColorIndex = 0
  461.        .TintAndShade = 0
  462.        .Weight = xlMedium
  463.    End With
  464.    With Selection.Borders(xlEdgeTop)
  465.        .LineStyle = xlDash
  466.        .ColorIndex = 0
  467.        .TintAndShade = 0
  468.        .Weight = xlMedium
  469.    End With
  470.    With Selection.Borders(xlEdgeBottom)
  471.        .LineStyle = xlDash
  472.        .ColorIndex = 0
  473.        .TintAndShade = 0
  474.        .Weight = xlMedium
  475.    End With
  476.    With Selection.Borders(xlEdgeRight)
  477.        .LineStyle = xlDash
  478.        .ColorIndex = 0
  479.        .TintAndShade = 0
  480.        .Weight = xlMedium
  481.    End With
  482.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  483.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  484.    Range("J22").Select
  485.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  486.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  487.    With Selection.Borders(xlEdgeLeft)
  488.        .LineStyle = xlDash
  489.        .ColorIndex = 0
  490.        .TintAndShade = 0
  491.        .Weight = xlMedium
  492.    End With
  493.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  494.    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  495.    With Selection.Borders(xlEdgeRight)
  496.        .LineStyle = xlDash
  497.        .ColorIndex = 0
  498.        .TintAndShade = 0
  499.        .Weight = xlMedium
  500.    End With
  501.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  502.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  503.    Range("K21").Select
  504.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  505.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  506.    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  507.    Selection.Borders(xlEdgeTop).LineStyle = xlNone
  508.    With Selection.Borders(xlEdgeBottom)
  509.        .LineStyle = xlDash
  510.        .ColorIndex = 0
  511.        .TintAndShade = 0
  512.        .Weight = xlMedium
  513.    End With
  514.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  515.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  516.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  517.    Range("K22").Select
  518.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  519.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  520.    With Selection.Borders(xlEdgeLeft)
  521.        .LineStyle = xlDash
  522.        .ColorIndex = 0
  523.        .TintAndShade = 0
  524.        .Weight = xlMedium
  525.    End With
  526.    With Selection.Borders(xlEdgeTop)
  527.        .LineStyle = xlDash
  528.        .ColorIndex = 0
  529.        .TintAndShade = 0
  530.        .Weight = xlMedium
  531.    End With
  532.    With Selection.Borders(xlEdgeBottom)
  533.        .LineStyle = xlDash
  534.        .ColorIndex = 0
  535.        .TintAndShade = 0
  536.        .Weight = xlMedium
  537.    End With
  538.    Selection.Borders(xlEdgeRight).LineStyle = xlNone
  539.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  540.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  541.    Range("K22").Select
  542.    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  543.    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  544.    With Selection.Borders(xlEdgeLeft)
  545.        .LineStyle = xlDash
  546.        .ColorIndex = 0
  547.        .TintAndShade = 0
  548.        .Weight = xlMedium
  549.    End With
  550.    With Selection.Borders(xlEdgeTop)
  551.        .LineStyle = xlDash
  552.        .ColorIndex = 0
  553.        .TintAndShade = 0
  554.        .Weight = xlMedium
  555.    End With
  556.    With Selection.Borders(xlEdgeBottom)
  557.        .LineStyle = xlDash
  558.        .ColorIndex = 0
  559.        .TintAndShade = 0
  560.        .Weight = xlMedium
  561.    End With
  562.    With Selection.Borders(xlEdgeRight)
  563.        .LineStyle = xlDash
  564.        .ColorIndex = 0
  565.        .TintAndShade = 0
  566.        .Weight = xlMedium
  567.    End With
  568.    Selection.Borders(xlInsideVertical).LineStyle = xlNone
  569.    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  570.    ChDir "C:\Users\Alex\Downloads"
  571.    ActiveWorkbook.SaveAs Filename:= _
  572.        "C:\Users\Alex\Downloads\Tabla de Amortización.xlsm", FileFormat:= _
  573.        xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
  574.    ActiveWorkbook.Save
  575.    Application.ScreenUpdating = True
  576. End Sub

El error dice:
Se ha producido el error '1004' en tiempo de ejecución
Error en el metodo Paste de la clase worksheet

MOD: Etiqueta GeSHi


« Última modificación: 5 Noviembre 2018, 16:03 pm por MCKSys Argentina » En línea

MCKSys Argentina
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.518


Diviértete crackeando, que para eso estamos!


Ver Perfil
Re: Ayuda con VBA en excel :c
« Respuesta #1 en: 5 Noviembre 2018, 16:07 pm »

Hola!

Probaste debuggear para ver dónde está el error y porqué puede estar ocurriendo?

Te dejo info: https://www.excel-easy.com/vba/examples/debugging.html

Saludos!


En línea

MCKSys Argentina

"Si piensas que algo está bien sólo porque todo el mundo lo cree, no estás pensando."

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
programacion en visual basic.ayuda para importar de excel a excel
Programación Visual Basic
Railil 2 4,620 Último mensaje 20 Junio 2006, 16:08 pm
por Railil
ayuda con excel vb6.0
Programación Visual Basic
<[(x)]> 0 1,440 Último mensaje 29 Octubre 2010, 07:09 am
por <[(x)]>
Ayuda Excel
Software
yamatho 0 1,377 Último mensaje 1 Febrero 2011, 23:55 pm
por yamatho
[Excel][VB6] Ejecutar archivo Excel.Solucionado
Programación Visual Basic
FranciskoAsdf 2 3,582 Último mensaje 15 Julio 2014, 04:33 am
por FranciskoAsdf
No se cierra el proceso excel VB.NET Excel 2007 VS 2010
.NET (C#, VB.NET, ASP)
Yaldabaot 8 8,133 Último mensaje 23 Octubre 2015, 18:01 pm
por Yaldabaot
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines