Jump to content

¿Cómo agregar un proceso de sumado para agregar puntos?


osccorp1

Recommended Posts

quisiera saber como agrego un numero para ir sumando o ir de forma asendente (1,2,3...) o desendente (-1,-2,-3), lo cual deseo que lo hago una macro hasta ahora tengo esto:

Sheets("MODIFICAR").Select

Range("H10").Select

ActiveCell.FormulaR1C1 = "=SUM(RC[1]+PUNTOS!R[2]C[-5])"

Range("H10").Select

Selection.Copy

Range("G10").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Range("I10").Select

Application.CutCopyMode = False

ActiveCell.FormulaR1C1 = "=RC[-2]"

Range("I11").Select

Range("G5").Select

Sheets("MODIFICAR").Select

Range("H10:I10").Select

With Selection.Font

.ThemeColor = xlThemeColorDark1

.TintAndShade = 0

End With

Range("G10").Select

With Selection.Interior

.Pattern = xlSolid

.PatternColorIndex = xlAutomatic

.ThemeColor = xlThemeColorDark1

.TintAndShade = -0.349986266670736

.PatternTintAndShade = 0

End With

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

Selection.Borders(xlInsideVertical).LineStyle = xlNone

Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

Selection.Borders(xlInsideVertical).LineStyle = xlNone

Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

Sheets("PUNTOS").Select

Range("C11").Select

Selection.ClearContents

pero tengo que hacerlo celda por celda, ya que es un registro de clientes para que se les otorgue un premio llegando a cierto puntaje, como puedo hacer esto para que lo haga las demas celda sin necesidad de hacrelo de esta manera

Link to comment
Share on other sites

Holaosccorp1

Intenta simplificar la consulta ,no hace falta aplicar color,borde,tipo de linea,etc... de la celda para incrementar el valor de la misma.

Como se trata de solucionar el tema con una macro hay un apartado para ello ,puedes editar aqui el tema.

[TABLE=width: 80]

[TR]

[TD=class: xl64, width: 80]Macros y programación VBA[/TD]

[/TR]

[/TABLE]

Sube un archivo de ejemplo ,si tienes alguna duda echale un vistazo a las reglas del foro:.

Reglas del Foro

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Privacy Policy