Programalama > VISUAL BASIC


Ort. 0
Puan ver:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Project/References menülerinden "Microsoft Excel 10.0 Object Library" ekleyin,
 
Formunuza 9 adet text kutusu, 9 adet label ve bir adet command butonu ekleyin,
 
ve aşağıdaki kodları olduğu gibi forma yapıştırın ve çalıştırın.
 
Dim c As Excel.Range
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
 
 
Sub ExcelAra()
On Error GoTo hata
Set xlApp = New Excel.Application
 
Text2.Text = ""
 
Set xlBook = Workbooks.Open(App.Path & "\devlet_kurumlari.xls", , True)
Set xlSheet = xlBook.Worksheets("sheet 1")
 
 
With xlSheet.Range("a1:c65536")
Set c = .Find(Trim(Text1.Text), lookin:=xlValues)
If Not c Is Nothing Then
 
firstAddress = c.Address
 
Text2.Text = c.Address
 
 
Range(Text2.Text).Select
Text3.Text = Excel.ActiveCell.Row
 
'??????_______Kurum Adı
Range("$d$" & Text3.Text).Select
Text4.Text = Excel.ActiveCell
 
'??????_______Kurum İli
Range("$a$" & Text3.Text).Select
Text5.Text = Excel.ActiveCell
 
'??????_______Kurum İlçesi
Range("$b$" & Text3.Text).Select
Text6.Text = Excel.ActiveCell
 
'??????_______Kurum Telefonu
Range("$e$" & Text3.Text).Select
Text7.Text = Excel.ActiveCell
MaskEdBox1.Text = Excel.ActiveCell
'??????_______Kurum Fax
Range("$f$" & Text3.Text).Select
Text8.Text = Excel.ActiveCell
 
'??????_______Kurum Adres
Range("$g$" & Text3.Text).Select
Text9.Text = Excel.ActiveCell
 
 
 
Do
c.Interior.Pattern = xlPatternGray50
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
 
If Text2.Text = "" Then Text2.Text = "Bulunamadı..."
 
 
 
 
xlBook.Close False
xlApp.Quit
 
Exit Sub
hata:
MsgBox Err.Description
 
End Sub
 
Private Sub Command1_Click()
ExcelAra
End Sub


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2025 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.