JohnHarmeston
New Member
- Joined
- Apr 17, 2019
- Messages
- 7
Hey,
I've been having issues trying to set this up so was hoping someone could let me know how badly I'm messing up.
I have on sheet one, B15, a drop box that shows from:
- "Single"
- "Multi x2"
- "Multi x3"
etc until x10
and on another sheet, information that fills in the C column if x2 is selected, D column if the x3 column is selected etc and to remove all information should the lesser multi / single was selected, ie the D column onwards is deleted should you select a x2 or less.
What I'm wanting to add however are borders that surround the information should the correct selection be chosen; but with gaps in between some rows; like C19:C26 to be bordered, then C29:C33 and so on (The spacing isn't consistant however). And also to unhide the appropriate columns and re-hide them automatically.
And also when you choose the lesser multi size, to then delete the borders that no longer have any information in.
I've pasted the code below, any help would be appreciated! And sorry for the novel, haha.
I've been having issues trying to set this up so was hoping someone could let me know how badly I'm messing up.
I have on sheet one, B15, a drop box that shows from:
- "Single"
- "Multi x2"
- "Multi x3"
etc until x10
and on another sheet, information that fills in the C column if x2 is selected, D column if the x3 column is selected etc and to remove all information should the lesser multi / single was selected, ie the D column onwards is deleted should you select a x2 or less.
What I'm wanting to add however are borders that surround the information should the correct selection be chosen; but with gaps in between some rows; like C19:C26 to be bordered, then C29:C33 and so on (The spacing isn't consistant however). And also to unhide the appropriate columns and re-hide them automatically.
And also when you choose the lesser multi size, to then delete the borders that no longer have any information in.
I've pasted the code below, any help would be appreciated! And sorry for the novel, haha.
Code:
Sub BorderMultix2()
Dim rng As Range
Set rng1 = Range("'Case Creation'!C21:C26")
Set rng2 = Range("'Case Creation'!C29:C33")
Set rng3 = Range("'Case Creation'!C35:C37")
Set rng4 = Range("'Case Creation'!C45:C48")
If Range("'ID&V (Stub)'!B15").Value = "Single" Then
With rng1.Borders.LineStyle = xlNone
With rng2.Borders.LineStyle = xlNone
With rng3.Borders.LineStyle = xlNone
With rng4.Borders.LineStyle = xlNone
End With
End With
End With
End With
Else
With rng1.Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
With rng2.Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
With rng3.Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
With rng4.Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
End With
End With
End With
End With
End If
End Sub