Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

string - tip varijeble (promenjive)- da ili ne

[es] :: Office :: Excel :: string - tip varijeble (promenjive)- da ili ne

[ Pregleda: 1124 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

gatalinka

Član broj: 201383
Poruke: 53
*.adsl.net.t-com.hr.



Profil

icon string - tip varijeble (promenjive)- da ili ne10.12.2009. u 18:50 - pre 175 meseci
evo koda, a onda ću objasniti problem


Sub nadi()

Dim trazi As String

Dim rng As Range
Dim Msg, Style, Title, Help, Ctxt, Response, MyString


trazi = InputBox("ŠTO SE TRAŽI", "TRAŽENJE ZADANOG KRITERIJA")
Cells.Find(what:=trazi, after:=ActiveCell, LookIn:=xlFormulas, lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, searchformat:=True).Activate
Do
If trazi = True Then
Msg = "Želite li selektirati i obrisati red?"
Style = vbYesNoCancel + vbInformation + vbDefaultButton2 ' Define buttons.
Title = "DALJNJI POSTUPCI" ' Define title.
'Help = "DEMO.HLP" ' Define Help file.
'Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)

If Response = vbYes Then ' User chose Yes.
Set rng = ActiveSheet.UsedRange.Find(trazi)
Rows(rng.Row).Delete

Else ' User chose No.
Cells.Find(what:=trazi, after:=ActiveCell, LookIn:=xlFormulas, lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, searchformat:=True).Activate
End If
If Response = vbCancel Then
Exit Sub
End If
End If
Loop

End Sub





kada u varijablu trazi upišem broj, tada ovo gore radi normalno, a kada upišem neki tekst (mobis ili sl), javlja grešku. (nije mi jasno jer je var trazi dimenzionirana kao string)

inače, kod traži neku vrijednost, i po potrebi briše red ili ide dalje ili izađe.
 
Odgovor na temu

[es] :: Office :: Excel :: string - tip varijeble (promenjive)- da ili ne

[ Pregleda: 1124 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.