• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Soru EXCELDE ÇOKLU İŞLEM YAPTIRMAK

Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Merhaba

Excel vba da aynı anda çoklu işlem yaptırmamız mümkünmü

Örneğin elimde 1000 tane veri var bu veriler için webden sorgu atıyorum , ama i döngüsü olduğu için teker teker yapıyor bu 1000 tanesi 30 dk sürüyor bunu 4 er 8 er aynı anda sorgu attırıp süreyi 5-10 dk ya düşürme şansımız varmı ?
 
Sorgu yaptığınız web sitesi buna müsade ediyorsa elbette yapılabilir.
 
izin veriyor peki nasıl yapılabilir excelin hangi özelliğini kullanmamız gerekiyor
 
Kullandığınız kodu revize etmeniz gerekiyor.
 
Kullandığınız kodu revize etmeniz gerekiyor.
Private Sub CommandButton1_Click() ' veri al
On Error Resume Next






Dim i As Integer
For i = 2 To Sayfa1.Cells(1, 1) + 1
With ActiveSheet.QueryTables.Add(Connection:="URL;http://testing" & Sayfa2.Cells(i, 1), _
Destination:=Range("D1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With




'//////////////////////////////////////////////////////////////////////
Sayfa2.Cells(i, 2) = Sayfa1.Cells(4, 5) ' gö
Sayfa2.Cells(i, 3) = Sayfa1.Cells(5, 5)
Sayfa2.Cells(i, 4) = Sayfa1.Cells(6, 5)
Sayfa2.Cells(i, 5) = Sayfa1.Cells(7, 5)
Sayfa2.Cells(i, 6) = Sayfa1.Cells(8, 5)
Sayfa2.Cells(i, 7) = Sayfa1.Cells(9, 5)
Sayfa2.Cells(i, 8) = Sayfa1.Cells(11, 5)
'///////////////////////////////////////////////////////////////////////////
Sayfa2.Cells(i, 9) = Sayfa1.Cells(4, 7) ' a
Sayfa2.Cells(i, 10) = Sayfa1.Cells(5, 7)
Sayfa2.Cells(i, 11) = Sayfa1.Cells(6, 7)
Sayfa2.Cells(i, 12) = Sayfa1.Cells(7, 7)
Sayfa2.Cells(i, 13) = Sayfa1.Cells(8, 7)
'///////////////////////////////////////////////////////////////////////////
Sayfa2.Cells(i, 14) = Sayfa1.Cells(13, 4) ' g
Sayfa2.Cells(i, 15) = Sayfa1.Cells(13, 6) ' A
'///////////////////////////////////////////////////////////////////////////
Sayfa2.Cells(i, 16) = Sayfa1.Cells(15, 4) ' k
Sayfa2.Cells(i, 17) = Sayfa1.Cells(15, 5) '
Sayfa2.Cells(i, 18) = Sayfa1.Cells(15, 6) '
Sayfa2.Cells(i, 19) = Sayfa1.Cells(15, 7) '
Sayfa2.Cells(i, 20) = Sayfa1.Cells(15, 8) '
'///////////////////////////////////////////////////////////////////////////
'

Sayfa2.Cells(i, 21) = Sayfa1.Cells(17, 4) '
Sayfa2.Cells(i, 22) = Sayfa1.Cells(17, 5) '
Sayfa2.Cells(i, 23) = Sayfa1.Cells(17, 6) '
Sayfa2.Cells(i, 24) = Sayfa1.Cells(17, 7) '
Sayfa2.Cells(i, 25) = Sayfa1.Cells(17, 8) '
Sayfa2.Cells(i, 26) = Sayfa1.Cells(17, 9) '
'///////////////////////////////////////////////////////////////////////////


Sayfa2.Cells(i, 27) = Sayfa1.Cells(19, 4) 'B
Sayfa2.Cells(i, 28) = Sayfa1.Cells(19, 5) 'H
Sayfa2.Cells(i, 29) = Sayfa1.Cells(19, 6) 'M
Sayfa2.Cells(i, 30) = Sayfa1.Cells(19, 7) 'Ma
Sayfa2.Cells(i, 31) = Sayfa1.Cells(19, 8) 'P
Sayfa2.Cells(i, 32) = Sayfa1.Cells(19, 9) 'Ha
'///////////////////////////////////////////////////////////////////////////
'

Sayfa2.Cells(i, 33) = Sayfa1.Cells(21, 4) 'G
Sayfa2.Cells(i, 34) = Sayfa1.Cells(21, 5) ' Gü
Sayfa2.Cells(i, 35) = Sayfa1.Cells(21, 6) '
Sayfa2.Cells(i, 36) = Sayfa1.Cells(21, 7) ' Yu
Sayfa2.Cells(i, 37) = Sayfa1.Cells(21, 8) ' T
'///////////////////////////////////////////////////////////////////////////
'Varış Ülkesi Uçak/Yüzey NVI Poşet No

Sayfa2.Cells(i, 38) = Sayfa1.Cells(23, 4) '
Sayfa2.Cells(i, 39) = Sayfa1.Cells(23, 5) ' U
Sayfa2.Cells(i, 40) = Sayfa1.Cells(23, 6) 'o
'///////////////////////////////////////////////////////////////////////////
'Kart Türü Sözleşme Türü Yurtdışı Gümrük Değeri

Sayfa2.Cells(i, 41) = Sayfa1.Cells(25, 4) 'K
Sayfa2.Cells(i, 42) = Sayfa1.Cells(25, 5) 'S
Sayfa2.Cells(i, 43) = Sayfa1.Cells(25, 6) 'Yurt
'///////////////////////////////////////////////////////////////////////////
'

Sayfa2.Cells(i, 44) = Sayfa1.Cells(27, 4) 'R
Sayfa2.Cells(i, 45) = Sayfa1.Cells(27, 5) 'Te
Sayfa2.Cells(i, 46) = Sayfa1.Cells(27, 6) 'Y
'/////////////////////////////////////////////
'G
Sayfa2.Cells(i, 47) = Sayfa1.Cells(29, 4) 'G
Sayfa2.Cells(i, 48) = Sayfa1.Cells(29, 5) 'Po
Sayfa2.Cells(i, 49) = Sayfa1.Cells(29, 6) '
'//////////////////
Sayfa2.Cells(i, 50) = Range("D" & [E1000].End(3).Row).Value
Sayfa2.Cells(i, 51) = Range("E" & [E1000].End(3).Row).Value
Sayfa2.Cells(i, 52) = Range("F" & [F1000].End(3).Row).Value
Sayfa2.Cells(i, 53) = Range("G" & [G1000].End(3).Row).Value
Sayfa2.Cells(i, 54) = Range("H" & [H1000].End(3).Row).Value
Sayfa2.Cells(i, 55) = Range("I" & [I1000].End(3).Row).Value
Sayfa2.Cells(i, 56) = Range("J" & [J1000].End(3).Row).Value 'İŞLEM SON
'//////////////////////////////////////////////////////////////////////




Range("D1:AB1201").Select
Selection.QueryTable.Delete
Selection.QueryTable.Delete
Selection.ClearContents

Sayfa1.Cells(42, 2) = i
Sayfa1.Cells(43, 2) = Sayfa1.Cells(41, 2) - i + 1
Next i


Call Makro1
' Sayfa1.Cells(41, 2) = ""
Sayfa1.Cells(42, 2) = ""
Sayfa1.Cells(43, 2) = ""


End Sub





Kullandığım kod bu , linki paylaşamıyorum revize edilecek kısımları yazarsanız sevinirim
 
Kullandığınız webden veri sorgulama tekniğini değiştirmelisiniz. Forumda daha hızlı webden veri çeken teknikler var.



Kullandığınız yöntemi çoklu yapabilirmisiniz diye araştırdığımda aşağıdaki bilgiye ulaştım. İşinize yararsa inceleyebilirsiniz.

 
Hocam bilgiler için teşekkür ederim ama yapamadım hala başka yöntem varsa eğer iyi olur
 
Geri
Üst