Home > Software engineering >  Someone sent me a excel with macros on his computer to run but does suggest of memory in my computer
Someone sent me a excel with macros on his computer to run but does suggest of memory in my computer

Time:10-03

This macro command is automatically grab a site data
http://www27392u.sakura.ne.jp/index_news.cgi
Under the 2014 autumn plate under data

Fetching the data

Hope god help me to look at the content of the vba code where there is error

CodePudding user response:

Because I can't upload attachments
So I just copy down the code to the
Hope god help me have a look

CodePudding user response:

With yellow it is a choice after the commissioning of new

Sub Replace_Old ()

Application. ScreenUpdating=False

'Delete If Exist
If Worksheets (7). The Name=Month (Date) & amp; ". "& amp; Day (Date) Then
Application. DisplayAlerts=False
Sheets (7). The Delete
Application. DisplayAlerts=True
End the If

'Copy Old Table
Sheets (7). The Range (" A4: M100 approximately "). Copy


'Paste Old Table
Sheets (" OLD "). The Range (" A4 "). The PasteSpecial

End Sub



Sub Update_New ()

Application. ScreenUpdating=False

'Sort Records
With Worksheets (" NEW "). AutoFilter. Sort
. SortFields. Clear
. SortFields. Add the Key:=Range (" D2: D13 "), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
The Header=xlYes
The MatchCase=False
The Orientation=xlTopToBottom
. SortMethod=xlPinYin
. Apply
End With

With Worksheets (" NEW "). AutoFilter. Sort
. SortFields. Clear
. SortFields. Add the Key:=Range (" A2: A13 "), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
The Header=xlYes
The MatchCase=False
The Orientation=xlTopToBottom
. SortMethod=xlPinYin
. Apply
End With

'the Clear Border Colors & amp; Thickness and Background Color
Dim NewForm As Range

The Set NewForm=Range (Worksheets (" NEW "). The Range (" A4: M4 "), and Worksheets (" NEW "). The Range (" A4: M4 "). The End (xlDown))

With NewForm
Borders (xlInsideVertical). ColorIndex=0
Borders (xlInsideVertical). Weight=xlThin
Borders (xlInsideHorizontal). ColorIndex=0
Borders (xlInsideHorizontal). Weight=xlThin
. The Interior. The Pattern=xlNone
. Interior. TintAndShade=0
. Interior. PatternTintAndShade=0
End With

'the Draw Lines
Dim As Integer I
I=4

The Do While I & lt; 61

If Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/6 Then '82515
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (165, 42, 42)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
ElseIf Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/5 Then 33813
'Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (255, 215, 0)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
ElseIf Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/4 Then 10000
'Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (255, 0, 0)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
ElseIf Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/3 Then 5000
'Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (255, 255, 0)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
ElseIf Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/2 Then 2899
'Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (50, 205, 50)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
ElseIf Worksheets (" OLD ".) Cells (I, "N"). The Value=https://bbs.csdn.net/topics/1 Then 883
'Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Color=RGB (0, 0, 255)
Worksheets (" NEW "). The Range (" A4: M4 "). The Offset (I - 4, 0). The Borders (xlEdgeBottom). Weight=xlThick
End the If

I=I + 1
Loop

End Sub


Sub Copy_New ()

'Create Sheet
Worksheets. Add after:=Worksheets (6)

'Copy New
Worksheets (1). Cells. Copy

'the Paste to the New Sheet
Application. DisplayAlerts=False
With Worksheets (7)
.name=Month (Date) & amp; ". "& amp; Day (Date)
The Paste
. Cells. Copy
Range (" A1 "). The PasteSpecial Paste:=xlPasteValues
The Visible=False
End With
Application. DisplayAlerts=True

End Sub

Sub ObtainData ()

Application. ScreenUpdating=False

'Cumulative PT Now
'the Clear Target Cells
Sheets (" CU "). The Range (" $A $1: $G $3500 "). The AutoFilter
Sheets (" Main "). The Range (" $A $1: $G $3500 "). The AutoFilter
Sheets (" Main "). The Range (" A2: A10000 "). The Clear

Application. The StatusBar="Loading Cumulative PT from Sakura."

'to refer to the running copy of Internet Explorer
Dim As ie InternetExplorer

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • VBA
  • Related