Babyfacebr3
New Member
- Joined
- Sep 2, 2015
- Messages
- 1
Hi,
I am trying to create a MACRO that based off two different times that the user inputs into a message box will automatically create a thick bold border. For example:
<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
With the information above, I would like the items in red to have a border around it based of the user inputs of 10:15-14:15. I want the times from 10:15-Age 22-Age 76 -14:15 to have a thick box border around it. I am not very good at Vba but what I have so far is the following: ( I am probably way off, but here is my attempt)
Sub attempt()
Dim a As Range, cell As Range
a = Application.InputBox("Select a range1", "Get Range", Type:=8)
Dim b As Range, cell As Range
b = Application.InputBox("Select a range", "Get Range", Type:=8)
Range("a:Q34").Select
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
End Sub
Any help would be greatly appreciated.
I am trying to create a MACRO that based off two different times that the user inputs into a message box will automatically create a thick bold border. For example:
Line | Time | Name | Age | Destination |
1 | 9:15 | Chris | 21 | NV |
2 | 10:15 | Janet | 22 | NY |
3 | 11:15 | Lura | 34 | CA |
4 | 12:15 | Matt | 52 | CO |
5 | 13:15 | Ben | 65 | LI |
6 | 14:15 | Gary | 76 | PA |
7 | 15:15 | Jessica | 97 | US |
8 | 16:15 | Miranda | 23 | FL |
9 | 17:15 | Scotty | 65 | MN |
10 | 18:15 | Remy | 56 | MO |
11 | 19:15 | Poland | 90 | CT |
<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
With the information above, I would like the items in red to have a border around it based of the user inputs of 10:15-14:15. I want the times from 10:15-Age 22-Age 76 -14:15 to have a thick box border around it. I am not very good at Vba but what I have so far is the following: ( I am probably way off, but here is my attempt)
Sub attempt()
Dim a As Range, cell As Range
a = Application.InputBox("Select a range1", "Get Range", Type:=8)
Dim b As Range, cell As Range
b = Application.InputBox("Select a range", "Get Range", Type:=8)
Range("a:Q34").Select
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
End Sub
Any help would be greatly appreciated.