"vba default border" Code Answer's
You're definitely familiar with the best coding language VBA that developers use to develop their projects and they get all their queries like "vba default border" answered properly. Developers are finding an appropriate answer about vba default border related to the VBA coding language. By visiting this online portal developers get answers concerning VBA codes question like vba default border. Enter your desired code related query in the search bar and get every piece of information about VBA code related question on vba default border.
vba default border
' VBA ONLY
'===============================================================================
'>> SelectedCellsBordersForceDefault
'===============================================================================
' Makes all the borders of the selected cell(s) look like the default borders
'===============================================================================
Sub SelectedCellsBordersForceDefault()
Dim sFunct As String: sFunct = "SelectedCellsBordersForceDefault"
Dim bDebugging As Boolean: bDebugging = True
If (bDebugging = True) Then
Debug.Print Format(DateTime.Now, "hh:mm:ss") & " INFO " & sFunct & "| " _
& "Running.. [Cells to edit borders:" & Selection.Address & "]"
End If
'*********************************
' VALIDATIONS and declarations
'*********************************
'(DECLARATIONS)
Dim wbInit As Workbook: Set wbInit = ActiveWorkbook
Dim wsInit As Worksheet: Set wsInit = ActiveSheet
Dim s_rInit As String: s_rInit = Selection.Address
Dim sErrMsg As String
Dim rFocus As Range
Dim iLineStyle As Long 'Integer
Dim iThemeColor As Long 'Integer
Dim dTintAndShade As Double
Dim iWeight As Long 'Integer
Dim iNormalBorder(1) As Integer
Dim iGreyBorder(5) As Integer
On Error GoTo ErrHandling
'(SETTINGS/SETUP)
Application.ScreenUpdating = False
Set rFocus = Selection
iLineStyle = xlContinuous
iThemeColor = 3
dTintAndShade = -0.099978637
iWeight = xlThin
iNormalBorder(0) = xlDiagonalDown ' 5
iNormalBorder(1) = xlDiagonalUp ' 6
iGreyBorder(0) = xlEdgeLeft ' 7
iGreyBorder(1) = xlEdgeTop ' 8
iGreyBorder(2) = xlEdgeBottom ' 9
iGreyBorder(3) = xlEdgeRight ' 10
iGreyBorder(4) = xlInsideVertical ' 11
iGreyBorder(5) = xlInsideHorizontal ' 12
'---------------------------------
' WORK
'---------------------------------
'1) Do the general work
'Z) Reactivate the initial workbook/worksheet
'--(1)
With rFocus
For Each edge In iNormalBorder
.Borders(edge).LineStyle = xlNone
Next
For Each edge In iGreyBorder
With .Borders(edge)
.LineStyle = iLineStyle
.ThemeColor = iThemeColor
.TintAndShade = dTintAndShade
.Weight = iWeight
End With
Next
End With
'--(Z)
wbInit.Activate
wsInit.Activate
Range(s_rInit).Select
'-----------v-----------DEBUG INFO-----------v-----------
If (bDebugging = True) Then
Debug.Print Format(DateTime.Now, "hh:mm:ss") & " INFO " & sFunct & "| " _
& "Complete [if not debugging, make bDebugging = false]"
End If
Application.ScreenUpdating = True
Exit Sub
ErrHandling:
Application.ScreenUpdating = True
Debug.Print Format(DateTime.Now, "hh:mm:ss") & " INFO " & sFunct & "| " _
& " -> Failed"
MsgBox _
Title:="Errors in the function: " & sFunct _
, Prompt:=Err.Description _
& vbNewLine & sErrMsg _
, Buttons:=vbCritical
End Sub
All those coders who are working on the VBA based application and are stuck on vba default border can get a collection of related answers to their query. Programmers need to enter their query on vba default border related to VBA code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about vba default border for the programmers working on VBA code while coding their module. Coders are also allowed to rectify already present answers of vba default border while working on the VBA language code. Developers can add up suggestions if they deem fit any other answer relating to "vba default border". Visit this developer's friendly online web community, CodeProZone, and get your queries like vba default border resolved professionally and stay updated to the latest VBA updates.