D
desmarai
Sub ImportCarryLists()
'
' ImportCarryLists Macro
' Macro created 2000/07/07
'
'
MsgBox "Please select the previous month's file for importing Carry
Lists and forwarding balances.", vbOKOnly, FileOpen
CarryListFile = Application.GetOpenFilename
Workbooks.Open _
FileName:=CarryListFile
**Sheets(Array("JE Dental", "DIV 10", "DIV 11", "DIV 12", "DIV 14",
"DIV 20", "DIV 21", _
"DIV 30", "DIV 31", "DIV 32", "DIV 42", "DIV 43", "DIV 50",
"DIV 51", "DIV 80", _
"DIV 84", "Adjustments")).Copy
After:=Workbooks(1).Sheets("Dental Report")**
Worksheets("DIV 10").Unprotect
Worksheets("DIV 11").Unprotect
Worksheets("DIV 12").Unprotect
Worksheets("DIV 14").Unprotect
Worksheets("DIV 20").Unprotect
Worksheets("DIV 21").Unprotect
Worksheets("DIV 30").Unprotect
Worksheets("DIV 31").Unprotect
Worksheets("DIV 32").Unprotect
Worksheets("DIV 42").Unprotect
Worksheets("DIV 43").Unprotect
Worksheets("DIV 50").Unprotect
Worksheets("DIV 51").Unprotect
Worksheets("DIV 80").Unprotect
Worksheets("DIV 84").Unprotect
Sheets("PivotTable").Select
End Sub
Sub InsertFormulaHeadings()
' inputs formulas into Corrected Count and
' Carry List columns
Sheets("PivotTable").Select
Range("F3:F6").FormulaR1C1 = "=IF(R[1]C[-1]=0,0,RC[-1])"
Range("F7:F122").FormulaR1C1 =
"=IF(R[1]C[-2]=0,0,IF(RC[-3]="""",IF(R[1]C[-3]="""",R[-2]C+R[-4]C+R[-6]C,R[-2]C+R[-4]C+R[-6]C),RC[-2]))"
Range("F1").FormulaR1C1 = "Current Month"
Range("F2").FormulaR1C1 = "Corrected Count"
Range("G2").FormulaR1C1 = "Carry List"
Range("H2").FormulaR1C1 = "Adjust"
Range("I2").FormulaR1C1 = "Total"
Range("J1").FormulaR1C1 = "Previous Month"
Range("J2").FormulaR1C1 = "Bal Fwd"
Range("K2").FormulaR1C1 = "New"
Range("L2").FormulaR1C1 = "Left"
Range("M2").FormulaR1C1 = "Adjust"
Range("N2").FormulaR1C1 = "New Bal"
Range("O2").FormulaR1C1 = "Audit"
Range("F1:I1").Select
With Selection
..HorizontalAlignment = xlCenterAcrossSelection
..VerticalAlignment = xlBottom
..WrapText = False
..Orientation = 0
..ShrinkToFit = False
..MergeCells = False
End With
Range("J1:N1").Select
With Selection
..HorizontalAlignment = xlCenterAcrossSelection
..VerticalAlignment = xlBottom
..WrapText = False
..Orientation = 0
..ShrinkToFit = False
..MergeCells = False
End With
Range("F1:I2").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
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("J1:N2").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
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("O1:O2").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
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
'
' ImportCarryLists Macro
' Macro created 2000/07/07
'
'
MsgBox "Please select the previous month's file for importing Carry
Lists and forwarding balances.", vbOKOnly, FileOpen
CarryListFile = Application.GetOpenFilename
Workbooks.Open _
FileName:=CarryListFile
**Sheets(Array("JE Dental", "DIV 10", "DIV 11", "DIV 12", "DIV 14",
"DIV 20", "DIV 21", _
"DIV 30", "DIV 31", "DIV 32", "DIV 42", "DIV 43", "DIV 50",
"DIV 51", "DIV 80", _
"DIV 84", "Adjustments")).Copy
After:=Workbooks(1).Sheets("Dental Report")**
Worksheets("DIV 10").Unprotect
Worksheets("DIV 11").Unprotect
Worksheets("DIV 12").Unprotect
Worksheets("DIV 14").Unprotect
Worksheets("DIV 20").Unprotect
Worksheets("DIV 21").Unprotect
Worksheets("DIV 30").Unprotect
Worksheets("DIV 31").Unprotect
Worksheets("DIV 32").Unprotect
Worksheets("DIV 42").Unprotect
Worksheets("DIV 43").Unprotect
Worksheets("DIV 50").Unprotect
Worksheets("DIV 51").Unprotect
Worksheets("DIV 80").Unprotect
Worksheets("DIV 84").Unprotect
Sheets("PivotTable").Select
End Sub
Sub InsertFormulaHeadings()
' inputs formulas into Corrected Count and
' Carry List columns
Sheets("PivotTable").Select
Range("F3:F6").FormulaR1C1 = "=IF(R[1]C[-1]=0,0,RC[-1])"
Range("F7:F122").FormulaR1C1 =
"=IF(R[1]C[-2]=0,0,IF(RC[-3]="""",IF(R[1]C[-3]="""",R[-2]C+R[-4]C+R[-6]C,R[-2]C+R[-4]C+R[-6]C),RC[-2]))"
Range("F1").FormulaR1C1 = "Current Month"
Range("F2").FormulaR1C1 = "Corrected Count"
Range("G2").FormulaR1C1 = "Carry List"
Range("H2").FormulaR1C1 = "Adjust"
Range("I2").FormulaR1C1 = "Total"
Range("J1").FormulaR1C1 = "Previous Month"
Range("J2").FormulaR1C1 = "Bal Fwd"
Range("K2").FormulaR1C1 = "New"
Range("L2").FormulaR1C1 = "Left"
Range("M2").FormulaR1C1 = "Adjust"
Range("N2").FormulaR1C1 = "New Bal"
Range("O2").FormulaR1C1 = "Audit"
Range("F1:I1").Select
With Selection
..HorizontalAlignment = xlCenterAcrossSelection
..VerticalAlignment = xlBottom
..WrapText = False
..Orientation = 0
..ShrinkToFit = False
..MergeCells = False
End With
Range("J1:N1").Select
With Selection
..HorizontalAlignment = xlCenterAcrossSelection
..VerticalAlignment = xlBottom
..WrapText = False
..Orientation = 0
..ShrinkToFit = False
..MergeCells = False
End With
Range("F1:I2").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
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("J1:N2").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
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("O1:O2").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
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub