aradığım datayı bulma

Katılım
9 Şubat 2005
Mesajlar
14
Makro yardım aradığım datayı bulma

Merhaba,
Aşaığıda ekte yaptığım makro içine aradığım datayı ilgili excel içinde yoksa eğer aradığınız bulunamadı diyerek tekrar makro başına dönmesini nasıl sağlayabilirim.
Teşekürler..


bu makro konusunda yardım edecek kimse yokmu ?
 
Son düzenleme:
Katılım
14 Şubat 2006
Mesajlar
3,426
Excel Vers. ve Dili
(Excel 2016 - İngilizce)
Altın Üyelik Bitiş Tarihi
30-11-2022
Aşağıdaki kodları deneyiniz.

Kod:
Sub Find_Fonksiyonu()
basla:
Site = InputBox("Enter Site Kod (Ex: ED5043)")
Il_Kodu = Left(Site, 2)
If Il_Kodu = "IS" Then Filename = "[URL="file://\\DCISTGUP2\Transmission\public\Connection-Plans\Ericsson\MARMARA\ISTANBUL_CP.xls"]\\DCISTGUP2\Transmission\public\Connection-Plans\Ericsson\MARMARA\ISTANBUL_CP.xls[/URL]"
If Il_Kodu = "IZ" Then Filename = "[URL="file://\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\EGE_BOLGE\IZMIR_CP_04.03.08.xls"]\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\EGE_BOLGE\IZMIR_CP_04.03.08.xls[/URL]"
If Il_Kodu = "BO" Then Filename = "[URL="file://\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\BOLU-DUZCE_MERGE\BOLU-DUZCE_CP.xls"]\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\BOLU-DUZCE_MERGE\BOLU-DUZCE_CP.xls[/URL]"
If Filename = "" Then
MsgBox "Aradığınız Kayıt Bulunamadı"
GoTo basla
End If
Workbooks.Open Filename
Cells.Find(What:=Site, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
Selection.Font.ColorIndex = 3
.ColorIndex = 5
MsgBox "Site Bulundu"
End With
End Sub
 
Katılım
9 Şubat 2005
Mesajlar
14
Merhaba,

Aşağıdaki formülde hata veriyor.formül hatasımı yapmışım ?

Kod:
Cells.Find(What:=Site, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
[/QUOTE]


Aşağıdaki kodları deneyiniz.

Kod:
Sub Find_Fonksiyonu()
basla:
Site = InputBox("Enter Site Kod (Ex: ED5043)")
Il_Kodu = Left(Site, 2)
If Il_Kodu = "IS" Then Filename = "[URL="file://\\DCISTGUP2\Transmission\public\Connection-Plans\Ericsson\MARMARA\ISTANBUL_CP.xls"]\\DCISTGUP2\Transmission\public\Connection-Plans\Ericsson\MARMARA\ISTANBUL_CP.xls[/URL]"
If Il_Kodu = "IZ" Then Filename = "[URL="file://\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\EGE_BOLGE\IZMIR_CP_04.03.08.xls"]\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\EGE_BOLGE\IZMIR_CP_04.03.08.xls[/URL]"
If Il_Kodu = "BO" Then Filename = "[URL="file://\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\BOLU-DUZCE_MERGE\BOLU-DUZCE_CP.xls"]\\dcistgup2\Transmission\public\Connection-Plans\Ericsson\BOLU-DUZCE_MERGE\BOLU-DUZCE_CP.xls[/URL]"
If Filename = "" Then
MsgBox "Aradığınız Kayıt Bulunamadı"
GoTo basla
End If
Workbooks.Open Filename
Cells.Find(What:=Site, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
Selection.Font.ColorIndex = 3
.ColorIndex = 5
MsgBox "Site Bulundu"
End With
End Sub
 
Üst