Advertisement
Advertisement
| 08.18.2008 at 12:27PM PDT, ID: 23657460 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: |
Public Sub CreateWBDupItems()
Dim dupitemwb As Workbook
Dim createFileDevwb As Workbook
Dim createFileDevWS As Worksheet
Dim dupitemWS As Worksheet
Dim strFile As String
Dim w As Workbook
Dim i As Integer
Dim NS As Integer
Dim lastrow As Integer
i = 1 'Beginning point of the loop
NS = 2 'Beginning point of load file for unloaded costs
lastrow = Cells(Application.Rows.Count, 1).End(xlUp).Row
Set createFileDevwb = ActiveWorkbook ' Obtain a reference to this workbook (assumed active at macro start)
Set createFileDevWS = ActiveSheet
Set dupitemwb = Workbooks.Add
strFile = "C:\My Documents\UnloadedCosts" & CStr(Format(Now, "MMDDYYHHm")) & ".xls"
ActiveWorkbook.SaveAs Filename:=strFile
Set dupitemWS = ActiveSheet
'Add Headers, change font to bold
Range("A1").Select
ActiveCell.FormulaR1C1 = "Date Entered"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B1").Select
ActiveCell.FormulaR1C1 = "By Initials"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("C1").Select
ActiveCell.FormulaR1C1 = "Item Number"
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("A1").Select
'Create status worksheet
Do While i <= lastrow
If createFileDevWS.Cells(i, 4).Font.Color = vbRed And createFileDevWS.Cells(i, 4).Font.Bold = True Then
dupitemWS.Cells(NS, 1).Value = createFileDevWS.Cells(i, 1).Value
dupitemWS.Cells(NS, 2).Value = createFileDevWS.Cells(i, 2).Value
dupitemWS.Cells(NS, 3).Value = createFileDevWS.Cells(i, 3).Value
NS = NS + 1
End If
i = i + 1
Loop
'Autofit columns and right justify item number
Cells.Select
Selection.Columns.AutoFit
Columns("C:C").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'Sort by Date Entered,By Initals and then item number
Range("A1:C" & lastrow).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range( _
"B2"), Order2:=xlAscending, Key3:=Range("C2"), Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
'Go to first cell on worksheet
Range("A1").Select
'Save all open worksheets
For Each w In Application.Workbooks
w.Save
Next w
Exit Sub
End Sub
|