D
Doo0592
Hi all,
Can someone suggest how I can add code to the procedure below so that
all columns incuding j (and onwards) and all rows including 506 (and
onwards) will be hidden again at the end. I had thought that they would
stay hidden after the procedure is run but it just ends up mucking up
the row numbers...
Any help appreciated
Doo
Sub RMV_CASES_STORAGE()
ANS = MsgBox("This information is non-recoverable, have you copied it
to the STORAGE ARCHIVE FOLDER?", _
vbYesNo)
If ANS = vbNo Then
MsgBox ("Operation cancelled at your request."), vbOKOnly
Exit Sub
Else
MsgBox ("These cases will be deleted."), vbOKOnly
Rows("3:500").Select
Selection.Delete Shift:=xlUp
Range("B3:E500").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("B2:E2").Select
Range("E2").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
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
ActiveWindow.ScrollRow = 3
Range("B3:E12").Select
With Selection.Interior
.ColorIndex = 0
End With
Range("B501:E510").Select
With Selection.Interior
.ColorIndex = 40
End With
Range("B3").Select
End If
End Sub
Can someone suggest how I can add code to the procedure below so that
all columns incuding j (and onwards) and all rows including 506 (and
onwards) will be hidden again at the end. I had thought that they would
stay hidden after the procedure is run but it just ends up mucking up
the row numbers...
Any help appreciated
Doo
Sub RMV_CASES_STORAGE()
ANS = MsgBox("This information is non-recoverable, have you copied it
to the STORAGE ARCHIVE FOLDER?", _
vbYesNo)
If ANS = vbNo Then
MsgBox ("Operation cancelled at your request."), vbOKOnly
Exit Sub
Else
MsgBox ("These cases will be deleted."), vbOKOnly
Rows("3:500").Select
Selection.Delete Shift:=xlUp
Range("B3:E500").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("B2:E2").Select
Range("E2").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
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
ActiveWindow.ScrollRow = 3
Range("B3:E12").Select
With Selection.Interior
.ColorIndex = 0
End With
Range("B501:E510").Select
With Selection.Interior
.ColorIndex = 40
End With
Range("B3").Select
End If
End Sub