REM ***** BASIC ***** REM İlçeler listesi https://www.e-icisleri.gov.tr/Anasayfa/MulkiIdariBolumleri.aspx REM adresinden alınabiliyor. Ama düz bir biçimde değil! REM aşağıdaki makro oradaki dağının verileri düz SQL cümleleri haline getiriyor. REM 2023 08 11 REM Mucip:) Sub Main dim oDoc as object dim sheet as object dim sheet2 as object dim cell as object dim i as integer rem dim j as integer dim kolon as integer dim sehir as string dim ilce as string dim ilceAdet as integer dim takas as String dim hucre as string dim digerSatir as integer i = 0 digerSatir = 0 rem Cell = oSheet.getCellByPosition(lColumn, lRow)) oDoc = ThisComponent sheet = ThisComponent.Sheets(1) sheet2 = ThisComponent.Sheets(2) hucre = sheet.getCellByPosition(0,0).String takas = sheet.getCellByPosition(3,0).String while hucre <> "" if( hucre <> "" and takas <> "" ) then i = i + 1 sehir = hucre takas = sheet.getCellByPosition(3,i).String while (takas="" and hucre<>"") for j = 0 to 3 if j = 3 then kolon = 4 else kolon = j end if ilce = sheet.getCellByPosition(kolon,i).String if ilce<>"" and sehir<>"" then sheet2.getCellByPosition(0,digerSatir).String = "INSERT INTO ilceler(sehir, ilce) VALUES('"& sehir &"','"& ilce &"');" digerSatir = digerSatir + 1 end if next i = i + 1 takas = sheet.getCellByPosition(3,i).String hucre = sheet.getCellByPosition(0,i).String wend end if hucre = sheet.getCellByPosition(0,i).String takas = sheet.getCellByPosition(3,i).String wend MsgBox( i ) End Sub