Sub PROG_05565()
'
' PROG_05565 Macro
'
'
Range("A13").Select
Application.CutCopyMode = False
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\abq\PROG_05565.TXT", _
Destination:=Range("$A$13"))
.Name = "PROG_5565"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(36, 8, 9, 11, 9, 17)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("F:F,E:E,C:C").Select
Range("C1").Activate
Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
Columns("D:D").Select
Selection.NumberFormat = "m/d/yyyy"
Columns("A:G").Select
Range("G1").Activate
Columns("A:G").EntireColumn.AutoFit
Range("A12").Select
End Sub
Sub VOPS2()
'
' VOPS2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Range("A1:L14").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Columns("A:L").Select
Range("A2").Activate
Columns("A:L").EntireColumn.AutoFit
Columns("A:A").Select
Range("A2").Activate
Selection.ColumnWidth = 10.5
Range("F14").Select
Application.CutCopyMode = False
Selection.Copy
Range("A7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.Password = "LOBOS"
Columns(6).EntireColumn.Delete
Range("A7:K7").Select
Selection.Copy
End Sub
Sub VOPSRELATIVE()
'
' VOPSRELATIVE Macro
'
' Keyboard Shortcut: Ctrl+Shift+R
'
Dim ClientNumber2SearchFor As String
Dim ClientListToSearch As Variant
Dim Found As Boolean
ClientNumber2SearchFor = Workbooks("DISPFORM - BLANK.xlsm").Sheets("ShareFile").Range("A1").Value ' fully reference these addresses
MsgBox "ClientNumber2SearchFor value is " & ClientNumber2SearchFor
Found = False
Number = ActiveSheet.Cells(14, 1)
lastrow = 13
For Each c In Range(Cells(14, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1))
If Number <> c Then Exit For
lastrow = lastrow + 1
Next
If lastrow = 13 Then Exit Sub
Range("A1:M" & lastrow).Copy
Workbooks.Add
ActiveSheet.Paste
Range("A2").Activate
Columns("A:L").EntireColumn.AutoFit
Columns("A:A").Select
Range("A2").Activate
Selection.ColumnWidth = 10.5
Range("F14").Select
Application.CutCopyMode = False
Selection.Copy
Range("A7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ClientListToSearch = Split(Range("A14").Value, ",") ' fully reference these addresses
Found = False
For Each clientNumber In ClientListToSearch
answer = MsgBox("Checking " & Replace(ClientNumber2SearchFor, Chr(34), "") & " against " & Replace(clientNumber, Chr(34), "") & ". Carry on checking?", vbYesNo + vbQuestion, "Empty Sheet")
If answer = vbNo Then Exit For
If Trim(Replace(ClientNumber2SearchFor, Chr(34), "")) = Trim(Replace(clientNumber, Chr(34), "")) And Trim(Replace(clientNumber, Chr(34), "")) <> "" Then
Found = True
Exit For
End If
Next clientNumber
If Found = False Then MsgBox "not found" ' we can change this to protect the sheet later
If Found = True Then MsgBox "found"
ActiveWorkbook.Password = "SECRET"
Columns(6).EntireColumn.Delete
Range("A7:K7").Select
Selection.Copy
Workbooks("DISPFORM - BLANK.xlsm").Sheets(1).Rows("14:" & lastrow).EntireRow.Delete 'change the sheet number for each DISPO
End Sub