Moderatori: Anthony47, Flash30005
"URL;http://www.borsaitaliana.it/borsa//azioni/contratti.html?isin=IT0000064854&page=" & I
Destination:=Cells(rows.count,1).End(XLup).Offset(1,0)
Anthony47 ha scritto:Ciao dragonedellenuvole e benvenuto nel forum.
Prova a registrarti una macro mentre fai la prima query in modo soddisfacente; poi inserisci questo codice in un Do /Loop da cui esci quando nell' ultima posizione il Volume ultimo e' pari a Volume totale.
Nella macro inserirai un contatore I che partendo da 0 fai incrementare a fine di ogni query, e usi questo contatore per comporre il vero indirizzo di query, che sara'
- Codice: Seleziona tutto
"URL;http://www.borsaitaliana.it/borsa//azioni/contratti.html?isin=IT0000064854&page=" & I
In quanto a Destination, essa sara'in modo da accodare i nuovi dati ai precedenti.
- Codice: Seleziona tutto
Destination:=Cells(rows.count,1).End(XLup).Offset(1,0)
Se hai problemi a impostare il tutto posta ancora spiegando dove sei arrivato.
Ciao.
Sub Macro1()
'
' Macro1 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=IT0000064854&lang=it" _
, Destination:=Range("$A$1"))
.Name = "contratti.html?isin=IT0000064854&lang=it"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
Sub DatiQuery()
Application.ScreenUpdating = False
Application.Calculation = xlManual
Cells.Clear
On Error Resume Next
Selection.QueryTable.Delete
On Error GoTo 0
Range("A1").Select
UR = 1
For Rip = 1 To 1000
If Rip = 465 Then MsgBox Rip
If Rip = 1 Then
Pag = ""
Pag2 = "lang=it"
Else
Pag = Rip - 1
Pag2 = "page=" & Pag
End If
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=IT0000064854&" & Pag2 _
, Destination:=Range("A" & UR))
.Name = "contratti.html?isin=IT0000064854&" & Pag2
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
UR = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row + 1
If Range("A" & UR - 1).Text = "Ora" Then GoTo Salta
Range("A" & UR).Select
Next Rip
Salta:
URC = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row
For RC = URC To 2 Step -1
If Range("A" & RC).Text = "Ora" Then Rows(RC & ":" & RC).Delete
Next RC
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
For Rip = 1 To 1000 '<<<< cambiare questo valore
Sub DatiQuery()
Application.ScreenUpdating = False
Application.Calculation = xlManual
Cells.Select
Selection.Clear
On Error Resume Next
Selection.QueryTable.Delete
On Error GoTo 0
Range("A1").Select
UR = 1
[Z1] = Timer
For Rip = 0 To 1000
For Each RName In ThisWorkbook.Names
RName.Delete
Next RName
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=IT0000064854&page=" & Rip _
, Destination:=Range("A" & UR))
.Name = "contratti.html?isin=IT0000064854&"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
UR = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row + 1
If Range("A" & UR - 1).Text = "Ora" Then
If UR > 1 And Range("A" & UR-1).Text = "Ora" Then Rows(UR-1 & ":" & UR-1).Delete
GoTo Salta
End If
If UR > 1 And Range("A" & UR).Text = "Ora" Then Rows(UR & ":" & UR).Delete
Range("A" & UR).Select
Next Rip
Salta:
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
[Z2] = Timer
End Sub
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=" & MyISIN & "&page=" & Rip
Sub Pulsante2_Click()
Application.ScreenUpdating = False
Application.Calculation = xlManual
[b]Range("A:E").Select[/b]
On Error Resume Next
Selection.QueryTable.Delete
On Error GoTo 0
Range("A1").Select
UR = 1
[Z1] = Timer
For Rip = 0 To 1000
For Each RName In ThisWorkbook.Names
RName.Delete
Next RName
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=IT0001207098&page=" & Rip _
, Destination:=Range("A" & UR))
.Name = "contratti.html?isin=IT0001207098&"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
UR = Worksheets("A1").Range("A" & Rows.Count).End(xlUp).Row + 1
If Range("A" & UR - 1).Text = "Ora" Then
If UR > 1 And Range("A" & UR - 1).Text = "Ora" Then Rows(UR - 1 & ":" & UR - 1).Delete
GoTo Salta
End If
If UR > 1 And Range("A" & UR).Text = "Ora" Then Rows(UR & ":" & UR).Delete
Range("A" & UR).Select
Next Rip
Salta:
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
[Z2] = Timer
End Sub
Non capisco a quale problema fai riferimento (e quindi non so valutare nemmeno la soluzione che hai in mente)forse ho trovato la soluzione, ovvero caricare i dati piuttosto che da sinistra verso destra, da destra verso sinistra..
Sub ASROMA()
Application.ScreenUpdating = False
Application.Calculation = xlManual
Cells.Clear
On Error Resume Next
Selection.QueryTable.Delete
On Error GoTo 0
Range("A1").Select
UR = 1
For Rip = 1 To 1000
If Rip = 465 Then MsgBox Rip
If Rip = 1 Then
Pag = ""
Pag2 = "lang=it"
Else
Pag = Rip - 1
Pag2 = "page=" & Pag
End If
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=IT0001008876&" & Pag2 _
, Destination:=Range("A" & UR))
.Name = "contratti.html?isin=IT0001008876&" & Pag2
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
UR = Worksheets("ASROMA").Range("A" & Rows.Count).End(xlUp).Row + 1
If Range("A" & UR - 1).Text = "Ora" Then GoTo Salta
Range("A" & UR).Select
Next Rip
Salta:
URC = Worksheets("ASROMA").Range("A" & Rows.Count).End(xlUp).Row
For RC = URC To 2 Step -1
If Range("A" & RC).Text = "Ora" Then Rows(RC & ":" & RC).Delete
Next RC
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Range("F1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-3]=R[1]C[-3],0,RC[-2])"
Selection.AutoFill Destination:=Range("F1:F3"), Type:=xlFillDefault
Range("F1:F3").Select
Selection.AutoFill Destination:=Range("F1:F5"), Type:=xlFillDefault
Range("F1:F5").Select
Range("F1").Select
Selection.AutoFill Destination:=Range("F1:F23060"), Type:=xlFillDefault
Range("F1:F23060").Select
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.ScrollRow = 22989
ActiveWindow.ScrollRow = 22899
ActiveWindow.ScrollRow = 22718
ActiveWindow.ScrollRow = 22266
ActiveWindow.ScrollRow = 21679
ActiveWindow.ScrollRow = 20911
ActiveWindow.ScrollRow = 19647
ActiveWindow.ScrollRow = 17885
ActiveWindow.ScrollRow = 16260
ActiveWindow.ScrollRow = 14905
ActiveWindow.ScrollRow = 14227
ActiveWindow.ScrollRow = 13595
ActiveWindow.ScrollRow = 13053
ActiveWindow.ScrollRow = 12601
ActiveWindow.ScrollRow = 12285
ActiveWindow.ScrollRow = 11969
ActiveWindow.ScrollRow = 11608
ActiveWindow.ScrollRow = 11292
ActiveWindow.ScrollRow = 10976
ActiveWindow.ScrollRow = 10795
ActiveWindow.ScrollRow = 10705
ActiveWindow.ScrollRow = 10524
ActiveWindow.ScrollRow = 10253
ActiveWindow.ScrollRow = 10163
ActiveWindow.ScrollRow = 10117
ActiveWindow.ScrollRow = 9846
ActiveWindow.ScrollRow = 8988
ActiveWindow.ScrollRow = 7408
ActiveWindow.ScrollRow = 5692
ActiveWindow.ScrollRow = 4562
ActiveWindow.ScrollRow = 3885
ActiveWindow.ScrollRow = 3253
ActiveWindow.ScrollRow = 2711
ActiveWindow.ScrollRow = 2349
ActiveWindow.ScrollRow = 2033
ActiveWindow.ScrollRow = 1672
ActiveWindow.ScrollRow = 1266
ActiveWindow.ScrollRow = 949
ActiveWindow.ScrollRow = 769
ActiveWindow.ScrollRow = 588
ActiveWindow.ScrollRow = 407
ActiveWindow.ScrollRow = 136
ActiveWindow.ScrollRow = 1
Range("G1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]>R[1]C[-4],+RC[-1],-RC[-1])"
Selection.AutoFill Destination:=Range("G1:G7"), Type:=xlFillDefault
Range("G1:G7").Select
Selection.AutoFill Destination:=Range("G1:G23060"), Type:=xlFillDefault
Range("G1:G23060").Select
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.ScrollRow = 22989
ActiveWindow.ScrollRow = 23034
ActiveWindow.ScrollRow = 22989
ActiveWindow.ScrollRow = 22944
ActiveWindow.ScrollRow = 22899
ActiveWindow.ScrollRow = 22853
ActiveWindow.ScrollRow = 22808
ActiveWindow.ScrollRow = 22763
ActiveWindow.ScrollRow = 22673
ActiveWindow.ScrollRow = 22628
ActiveWindow.ScrollRow = 22492
ActiveWindow.ScrollRow = 22266
ActiveWindow.ScrollRow = 21860
ActiveWindow.ScrollRow = 21047
ActiveWindow.ScrollRow = 19963
ActiveWindow.ScrollRow = 19195
ActiveWindow.ScrollRow = 18608
ActiveWindow.ScrollRow = 18202
ActiveWindow.ScrollRow = 17795
ActiveWindow.ScrollRow = 17569
ActiveWindow.ScrollRow = 17343
ActiveWindow.ScrollRow = 17253
ActiveWindow.ScrollRow = 17163
ActiveWindow.ScrollRow = 16756
ActiveWindow.ScrollRow = 16711
ActiveWindow.ScrollRow = 16621
ActiveWindow.ScrollRow = 16485
ActiveWindow.ScrollRow = 16079
ActiveWindow.ScrollRow = 15040
ActiveWindow.ScrollRow = 13143
ActiveWindow.ScrollRow = 11247
ActiveWindow.ScrollRow = 9846
ActiveWindow.ScrollRow = 8808
ActiveWindow.ScrollRow = 8040
ActiveWindow.ScrollRow = 7498
ActiveWindow.ScrollRow = 7001
ActiveWindow.ScrollRow = 6504
ActiveWindow.ScrollRow = 6098
ActiveWindow.ScrollRow = 5646
ActiveWindow.ScrollRow = 5059
ActiveWindow.ScrollRow = 4201
ActiveWindow.ScrollRow = 2395
ActiveWindow.ScrollRow = 2349
ActiveWindow.ScrollRow = 2304
ActiveWindow.ScrollRow = 2259
ActiveWindow.ScrollRow = 2214
ActiveWindow.ScrollRow = 2124
ActiveWindow.ScrollRow = 2033
ActiveWindow.ScrollRow = 1898
ActiveWindow.ScrollRow = 1672
ActiveWindow.ScrollRow = 1175
ActiveWindow.ScrollRow = 588
ActiveWindow.ScrollRow = 91
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollRow = 46
ActiveWindow.ScrollRow = 91
ActiveWindow.ScrollRow = 136
ActiveWindow.ScrollRow = 182
ActiveWindow.ScrollRow = 227
ActiveWindow.ScrollRow = 272
ActiveWindow.ScrollRow = 317
ActiveWindow.ScrollRow = 362
ActiveWindow.ScrollRow = 407
ActiveWindow.ScrollRow = 453
ActiveWindow.ScrollRow = 498
ActiveWindow.ScrollRow = 543
ActiveWindow.ScrollRow = 588
ActiveWindow.ScrollRow = 633
ActiveWindow.ScrollRow = 678
ActiveWindow.ScrollRow = 724
ActiveWindow.ScrollRow = 769
ActiveWindow.ScrollRow = 724
ActiveWindow.ScrollRow = 678
ActiveWindow.ScrollRow = 633
ActiveWindow.ScrollRow = 588
ActiveWindow.ScrollRow = 498
ActiveWindow.ScrollRow = 453
ActiveWindow.ScrollRow = 362
ActiveWindow.ScrollRow = 272
ActiveWindow.ScrollRow = 227
ActiveWindow.ScrollRow = 136
ActiveWindow.ScrollRow = 91
ActiveWindow.ScrollRow = 46
ActiveWindow.ScrollRow = 1
Columns("G:G").ColumnWidth = 13.86
Windows("prova tick1.xlsx").Activate
Range("I5").Select
Windows("A.xlsm").Activate
ActiveWindow.SmallScroll Down:=-18
Range("H1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]>0,RC[-1],0)"
Selection.AutoFill Destination:=Range("H1:H23060"), Type:=xlFillDefault
Range("H1:H23060").Select
ActiveWindow.SmallScroll Down:=-63
ActiveWindow.ScrollRow = 22989
ActiveWindow.ScrollRow = 22944
ActiveWindow.ScrollRow = 22899
ActiveWindow.ScrollRow = 22808
ActiveWindow.ScrollRow = 22628
ActiveWindow.ScrollRow = 22040
ActiveWindow.ScrollRow = 20234
ActiveWindow.ScrollRow = 17253
ActiveWindow.ScrollRow = 14589
ActiveWindow.ScrollRow = 12421
ActiveWindow.ScrollRow = 10885
ActiveWindow.ScrollRow = 9711
ActiveWindow.ScrollRow = 8672
ActiveWindow.ScrollRow = 7363
ActiveWindow.ScrollRow = 5646
ActiveWindow.ScrollRow = 3659
ActiveWindow.ScrollRow = 1130
ActiveWindow.ScrollRow = 1085
ActiveWindow.ScrollRow = 995
ActiveWindow.ScrollRow = 859
ActiveWindow.ScrollRow = 453
ActiveWindow.ScrollRow = 1
Range("I1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]<0,RC[-2],0)"
Selection.AutoFill Destination:=Range("I1:I23060"), Type:=xlFillDefault
Range("I1:I23060").Select
ActiveWindow.ScrollRow = 22990
ActiveWindow.ScrollRow = 22945
ActiveWindow.ScrollRow = 22854
ActiveWindow.ScrollRow = 22674
ActiveWindow.ScrollRow = 22177
ActiveWindow.ScrollRow = 21364
ActiveWindow.ScrollRow = 20235
ActiveWindow.ScrollRow = 19106
ActiveWindow.ScrollRow = 17977
ActiveWindow.ScrollRow = 16712
ActiveWindow.ScrollRow = 15131
ActiveWindow.ScrollRow = 13505
ActiveWindow.ScrollRow = 11924
ActiveWindow.ScrollRow = 10299
ActiveWindow.ScrollRow = 8718
ActiveWindow.ScrollRow = 6414
ActiveWindow.ScrollRow = 6369
ActiveWindow.ScrollRow = 6234
ActiveWindow.ScrollRow = 6143
ActiveWindow.ScrollRow = 6008
ActiveWindow.ScrollRow = 5782
ActiveWindow.ScrollRow = 5466
ActiveWindow.ScrollRow = 5059
ActiveWindow.ScrollRow = 4563
ActiveWindow.ScrollRow = 4066
ActiveWindow.ScrollRow = 3614
ActiveWindow.ScrollRow = 3208
ActiveWindow.ScrollRow = 2892
ActiveWindow.ScrollRow = 2575
ActiveWindow.ScrollRow = 2304
ActiveWindow.ScrollRow = 2124
ActiveWindow.ScrollRow = 1898
ActiveWindow.ScrollRow = 1717
ActiveWindow.ScrollRow = 1582
ActiveWindow.ScrollRow = 1491
ActiveWindow.ScrollRow = 1446
ActiveWindow.ScrollRow = 1356
ActiveWindow.ScrollRow = 1311
ActiveWindow.ScrollRow = 1220
ActiveWindow.ScrollRow = 1130
ActiveWindow.ScrollRow = 1085
ActiveWindow.ScrollRow = 1040
ActiveWindow.ScrollRow = 995
ActiveWindow.ScrollRow = 949
ActiveWindow.ScrollRow = 904
ActiveWindow.ScrollRow = 814
ActiveWindow.ScrollRow = 724
ActiveWindow.ScrollRow = 678
ActiveWindow.ScrollRow = 543
ActiveWindow.ScrollRow = 407
ActiveWindow.ScrollRow = 272
ActiveWindow.ScrollRow = 1
Range("K12:L12").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = "Vol Acq"
Range("M12:N12").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = "Vol Vend"
Range("K13:L13").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("K12:N13").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("M13:N13").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("K14:N14").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("L15:M15").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("K14:N14").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("L15:M15").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("K13:L13").Select
ActiveCell.FormulaR1C1 = "=SUM(C[-3])"
Range("M13:N13").Select
ActiveCell.FormulaR1C1 = "=SUM(C[-4])"
Range("K14:N14").Select
ActiveCell.FormulaR1C1 = "Ind Acq/Vend"
Range("L15:M15").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-2]C[-1]:R[-2]C[2])"
Range("L16").Select
End Sub
Anthony47 ha scritto:Se la macro funziona va bene cosi', al massimo elimina tutti le righe con ActiveWindow.ScrollRow = xzym
Altri suggerimenti non ne darei, anche perche' non so che cosa devi fare nella seconda parte.
Ciao
For Each MyIsin in Sheets("Indice").Range("A2:A20") '<< Nome Foglio e intervallo codici ISIN
If MyIsin.value="" then Goto Skippa
On Error Resume Next : CCC=""
CCC = Sheets(MyIsin.Offset(0,1).Value).Name
If CCC = "" Then
Sheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = MyIsin.Offset(0,1).Value
End If
On Error GoTo 0
Sheets(MyIsin.offset(0,1).value).Select
'
'da qui in poi il codice della tua macro attuale, senza End Sub
'
Skippa:
Next MyIsin
End Sub
"URL;http://www.borsaitaliana.it/borsa/azioni/contratti.html?isin=" & MyIsin & "&" & Pag2 _
For Each RName In ThisWorkbook.Names
RName.Delete
Next RName
Torna a Applicazioni Office Windows
Macro per aprire file salvato su sharepoint Onedrive Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 2 |
Come impostare il formato data predefinito in excel? Autore: wallace&gromit |
Forum: Applicazioni Office Windows Risposte: 5 |
Come interrompere macro sndPlaySound Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Milanooooo e 12 ospiti