Selección de varios rangos para aplicar formato
Bueno me voy de frente a explicar la macro que deseo hacer, primero debe seleccionar un rango dado pejm (B6:F30), ahora seleccionar rangos dentro de este pejm (B6:F6) aplicarle negrita, centrado y todo los bordes; (B7:B30) aplicarle borde externo; (C7:F30)aplicarle borde externo, centrado;(C7:C30)y(F7:F30)aplicarle numero 2 decimales y finalmente al rango (D7:D30)aplicarle numero 3 decimales.
La macro que hice para seleccionar un rango y aplicarle un borde dado es el siguiente quizás por ahí estuviera la solución, espero su pronta respuesta experto, gracias.
Sub seleccion_reango()
a = InputBox("seleccionar primera celda del rango")
Range(a).CurrentRegion.Select
fila = Range("B65536").End(xlUp).Row
col = Range("IV" & fila).End(xlToLeft).Column
Range(a, Cells(fila, col)).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Range("B23").CurrentRegion.Select
fila = Range("B65536").End(xlUp).Row
col = Range("IV" & fila).End(xlToLeft).Column
Range("B23", Cells(fila, col)).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End Sub
La macro que hice para seleccionar un rango y aplicarle un borde dado es el siguiente quizás por ahí estuviera la solución, espero su pronta respuesta experto, gracias.
Sub seleccion_reango()
a = InputBox("seleccionar primera celda del rango")
Range(a).CurrentRegion.Select
fila = Range("B65536").End(xlUp).Row
col = Range("IV" & fila).End(xlToLeft).Column
Range(a, Cells(fila, col)).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Range("B23").CurrentRegion.Select
fila = Range("B65536").End(xlUp).Row
col = Range("IV" & fila).End(xlToLeft).Column
Range("B23", Cells(fila, col)).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End Sub
1 respuesta
Respuesta de deathwatch