Professional Documents
Culture Documents
' ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBBristol.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft Columns("E:V").Select Selection.Delete Shift:=xlToLeft Columns("A:D").Select Selection.Copy Windows("RawDataSummary.xlsm").Activate
ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBBirmingham.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft Columns("E:V").Select Selection.Delete Shift:=xlToLeft Columns("A:D").Select Selection.Copy
ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBNUL.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft Columns("E:V").Select Selection.Delete Shift:=xlToLeft Columns("A:D").Select
ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBMansfield.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft Columns("E:V").Select Selection.Delete Shift:=xlToLeft
ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBLeicester.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft Columns("E:V").Select
Selection.Delete Shift:=xlToLeft Columns("A:D").Select Selection.Copy Windows("RawDataSummary.xlsm").Activate Worksheets(5).Activate Range("A1").Select ActiveSheet.Paste Columns("A:D").Select Columns("A:D").EntireColumn.AutoFit
ChDir _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats" Workbooks.OpenText Filename:= _ "T:\IT&N\CND&D\CNP\Switching and Services\Mobile data\OUKBlackberry\IPCapacityMonitoring\NetTunerStats\BBLuton.xls" _ , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _ Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _ , 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), _ Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1)), TrailingMinusNumbers:=True Columns("D:E").Select Columns("F:F").ColumnWidth = 15.14 Selection.Delete Shift:=xlToLeft
Columns("E:V").Select Selection.Delete Shift:=xlToLeft Columns("A:D").Select Selection.Copy Windows("RawDataSummary.xlsm").Activate Worksheets(6).Activate Range("A1").Select ActiveSheet.Paste Columns("A:D").Select Columns("A:D").EntireColumn.AutoFit
End Sub
Sub ChangeDates()
Dim strDate As String Dim intDateLength As Integer Dim intMonth As Integer Dim intDay As Integer Dim intYear As Integer Dim intWhereIsTheSpace As Integer Dim intWhereIsTheColon As Integer Dim intHourLength As Integer Dim strHour As String Dim strMinute As String Dim strResult As String
Range("G2").Activate
End If
intWhereIsTheSpace = InStr(11, strDate, " ", vbTextCompare) intWhereIsTheColon = InStr(11, strDate, ":")
strHour = Mid(strDate, intWhereIsTheSpace, intHourLength) If Right(strDate, 2) = "PM" Then If strHour <> 12 Then strHour = CStr(CInt(strHour) + 12)
End If
strResult = intMonth & "/" & intDay & "/" & intYear & " " & strHour & ":" & strMinute & ":00"
ActiveCell.Offset(1, 0).Activate
Loop
End Sub
Public Function getMonth(ByVal strMonth As String) Dim intMonth As Integer Select Case strMonth
Case "Jan" intMonth = 1 Case "Feb" intMonth = 2 Case "Mar" intMonth = 3 Case "Apr" intMonth = 4 Case "May" intMonth = 5 Case "Jun" intMonth = 6 Case "Jul" intMonth = 7 Case "Aug" intMonth = 8 Case "Sep" intMonth = 9 Case "Oct" intMonth = 10 Case "Nov" intMonth = 11 Case "Dec" intMonth = 12 End Select
getMonth = intMonth
End Function
Sub Date_Conversion()
Dim strDate As String Dim intDateLength As Integer Dim intMonth As Integer Dim intDay As Integer Dim intYear As Integer Dim intWhereIsTheSpace As Integer Dim intWhereIsTheColon As Integer Dim intHourLength As Integer Dim strHour As String Dim strMinute As String Dim strResult As String
Range("G2").Activate
End If
intWhereIsTheSpace = InStr(11, strDate, " ", vbTextCompare) intWhereIsTheColon = InStr(11, strDate, ":")
strHour = Mid(strDate, intWhereIsTheSpace, intHourLength) If Right(strDate, 2) = "PM" Then If strHour <> 12 Then strHour = CStr(CInt(strHour) + 12)
End If
End If
strResult = intMonth & "/" & intDay & "/" & intYear & " " & strHour & ":" & strMinute & ":00"
ActiveCell.Offset(1, 0).Activate
Loop
End Sub
Public Function getMonth(ByVal strMonth As String) Dim intMonth As Integer Select Case strMonth Case "Jan" intMonth = 1 Case "Feb" intMonth = 2 Case "Mar" intMonth = 3 Case "Apr" intMonth = 4 Case "May" intMonth = 5 Case "Jun" intMonth = 6 Case "Jul" intMonth = 7 Case "Aug" intMonth = 8 Case "Sep" intMonth = 9 Case "Oct" intMonth = 10 Case "Nov" intMonth = 11 Case "Dec" intMonth = 12
End Select
getMonth = intMonth
End Function
Sub ChangeDates()
Dim strDate As String Dim intDateLength As Integer Dim intMonth As Integer Dim intDay As Integer Dim intYear As Integer Dim intWhereIsTheSpace As Integer Dim intWhereIsTheColon As Integer Dim intHourLength As Integer Dim strHour As String Dim strMinute As String Dim strResult As String
Range("G2").Activate
End If
intWhereIsTheSpace = InStr(11, strDate, " ", vbTextCompare) intWhereIsTheColon = InStr(11, strDate, ":")
strHour = Mid(strDate, intWhereIsTheSpace, intHourLength) If Right(strDate, 2) = "PM" Then If strHour <> 12 Then strHour = CStr(CInt(strHour) + 12)
End If
End If
strResult = intMonth & "/" & intDay & "/" & intYear & " " & strHour & ":" & strMinute & ":00"
ActiveCell.Offset(1, 0).Activate
Loop
End Sub
Public Function getMonth(ByVal strMonth As String) Dim intMonth As Integer Select Case strMonth Case "Jan" intMonth = 1 Case "Feb" intMonth = 2 Case "Mar" intMonth = 3 Case "Apr" intMonth = 4 Case "May" intMonth = 5 Case "Jun" intMonth = 6 Case "Jul" intMonth = 7 Case "Aug" intMonth = 8 Case "Sep" intMonth = 9 Case "Oct" intMonth = 10 Case "Nov"
getMonth = intMonth
End Function
For j = 1 To 100
For k = 1 To 96 ActiveCell.Value = WorksheetFunction.Max(ActiveCell.Offset((j * 96 - 1), -3).Value, ActiveCell.Offset(96 * j, -3)) ActiveCell.Offset(1, 0).Activate Next k
Next j
Sub Populate_Trend_equation_Values()
' ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Text Dim sh As Worksheet Dim ChActChart As Chart Dim SerActSeriesCol As SeriesCollection
Dim ObjTrendLine As Object Dim mySeriesCollection As SeriesCollection Dim myTrendlines As Trendlines Dim myTrendLine As Trendline Dim TrendActiveTrendLine As Trendline Dim strTrendLabel As String
myTrendLine = ActiveChart.SeriesCollection(3)
strTrendLabel = TrendActiveTrendLine.DataLabel
' ActiveChaRT.SeriesCollection(1).
End Sub
Dim strReportFileName As String Dim strRawData1 As String Dim strRawData2 As String Dim strRawData3 As String Dim strRawData4 As String Dim strRawData5 As String Dim strRawData6 As String Dim strRawDataPath As String Dim strRawDataFullPath As String
'strRawDataName1 = "OIBirmingham.xls" 'strRawDataName2 = "OIBristol.xls" 'strRawDataName3 = "OILeicester.xls" 'strRawDataName4 = "OILuton.xls" 'strRawDataName5 = "OIMansfield.xls" 'strRawDataName6 = "OINUL.xls"
'Dim oExcel As Excel.Application 'Dim oWB As Workbook 'Set oExcel = New Excel.Application ' Set oWB = oExcel.Workbooks.Open(E:\folder)
For i = 1 To 6
Workbooks.Open (strRawDataFullPath) Windows(strRawDataFile).Activate Range("A2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Windows(strReportFileName).Activate Sheets(intSheetNum).Activate Range("A2").Select Selection.End(xlDown).Select Selection.Offset(1).Select ActiveSheet.Paste
Windows(strRawDataFile).Activate Range("B2").Activate Range(Selection, Selection.End(xlDown)).Select Selection.Copy Windows(strReportFileName).Activate Sheets(intSheetNum).Activate Range("B2").Select Selection.End(xlDown).Select Selection.Offset(1).Select ActiveSheet.Paste
Windows(strRawDataFile).Activate Range("C2").Activate
Windows(strRawDataFile).Activate Range("F2").Activate Range(Selection, Selection.End(xlDown)).Select Selection.Copy Windows(strReportFileName).Activate Sheets(intSheetNum).Activate Range("D2").Select Selection.End(xlDown).Select Selection.Offset(1).Select ActiveSheet.Paste
Next i
End Sub
'Dim intFileNum As Integer ' Dim strRawFileName As Scenario Select Case intFileNum Case 1 strRawFileName = "OIBirmingham.xls" Case 2 strRawFileName = "OIBristol.xls" Case 3 strRawFileName = "OILeicester.xls" Case 4 strRawFileName = "OILuton.xls" Case 5 strRawFileName = "OIMansfield.xls" Case 6 strRawFileName = "OINUL.xls"
End Select
End Function