The start Sub Getdata() is highlighted yellow and at the bottom the End Sub is highlighted blue please help I'm lost. Thanks in advance.
Sub Getdata()
' Get Blend Log data from network drive and paste into Web Data worksheet
Dim Monthmmm, Yearyyyy, fname, path, pathfname, printall
Sheets("Web Data").Select
Let Monthmmm = Cells(4, 1).Value
Let Yearyyyy = Cells(3, 1).Value
Let path = "X:\Raw Water Reports\Blend Log\Blend Log 2012\"
fname = Monthmmm & " " & Yearyyyy & ".xlsx"
Let pathfname = path & fname
' Cells(1, 1).Value = pathfname
Workbooks.Open Filename:=pathfname, _
Notify:=False
Range("A1:M51").Select
Selection.Copy
Windows("Temporary 2012 Schematics3.xls").Activate
Sheets("Web Data").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues
' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
' :=False, Transpose:=False
' ActiveSheet.Paste
' Close Blend Log workbook; user is prompted to remove data from clipboard so user
' should click "NO" to remove data from clipboard; should refine in future.
Windows(fname).Activate
ActiveWindow.Close
' Get ALERT data from internal webpage and paste to Web Data worksheet
' http://alert3.valleywater.org/opsplandata.html
' (External webpage address http://alert.valleywater.org/gagestrm.html)
Range("AE4").Select
With Selection.QueryTable
.Connection = "URL;http://alert.valleywater.org/sgi.php"
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Range("AN4").Select
With Selection.QueryTable
.Connection = "URL;http://alert.valleywater.org/rgi.php"
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
' Print out all each water supply recharge system schematic
' will want to improve by adding a yes/no box to the code below
Let printall = InputBox("To print all Enter: Yes")
If printall = "Yes" Then
Sheets("Guadalupe").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Stevens Creek").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Los Gatos").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("South County").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Pennitencia").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Coyote").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
End With
Sheets("Web Data").Select
Range("A5").Select
End Sub
Sub Print_single_sheet()
'
' Print_single_sheet Macro
' Macro recorded 09/23/2006
' Print each individual system worksheet
'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False, Collate:= _
True
End Sub
Bookmarks