RE: Excel makro

From: Likavcan, Alexander (Alexander.Likavcan@volkswagen.sk)
Date: 20. 05. 2002, 14:32 CEST


Zdar a silu Simona, dna 20.05.2002 si napisal(a):

> Jo jo jo, to je ono :-)) Jasne, ze je to vzorec, pardon :-))  Jeste bych
> potrebovala poradit s makrem (tentokrat makro) :
> 
> Tohle potrebuji tak, aby se to lepilo jako vzorec,ovsem kdyz to napisu
> takto: 
> Sub zak()
> '
> ' zak Macro
> '
> '
>     ActiveCell.FormulaR1C1 = "=VLOOKUP(I1;ZAK!A:B;2;FALSE)"
>     ActiveCell.Calculate
>     
> End Sub
> 
> Tak to nebere...

VBA v kode nema moc rad vzorce, musis to napisat trosku inac:
activecell.FormulaR1C1= "=vlookup(RC[-1],ZAK!C[-9]:C[-8],2,0)"
R=row od activecell
C=column od activecell
takze v tomto pripade by musela byt aktivna bunka (activecell) v stlpci J 

no ale cistym makrom je to krajsie.

pohraj sa s tymto:

Sub prnr1()
odpoved = MsgBox("Ako Komentár ???", vbYesNo, "SpPes")
If odpoved = 6 Then
For Each bunka In Selection
    mykey = bunka
    If bunka.Comment Is Nothing Then
    Else
        bunka.Comment.Delete
    End If
Set foundcell =
Workbooks("Beschreibung.xla").Worksheets("polo").Columns("A:A").Find(mykey)
    If foundcell Is Nothing Then
        bunka.AddComment ("nenájdené")
    Else
        hodnota = foundcell.Offset(0, 1)
        If hodnota = "" Then
        bunka.AddComment ("nenájdené")
        Else
            If foundcell.Row < 110 Then bunka.Interior.ColorIndex = 40
            
        bunka.AddComment (hodnota)
        End If
    End If
Next
Else
For Each bunka In Selection
    mykey = bunka
    If bunka.Comment Is Nothing Then
    Else
        bunka.Comment.Delete
    End If
Set foundcell =
Workbooks("Beschreibung.xla").Worksheets("polo").Columns("A:A").Find(mykey)
    If foundcell Is Nothing Then
        bunka.Offset(0, 1) = "nenájdené"
    Else
        hodnota = foundcell.Offset(0, 1)
        If hodnota = "" Then
        bunka.Offset(0, 1) = "nenájdené"
        Else
            If foundcell.Row < 110 Then
                bunka.Offset(0, 1) = "pak; " & hodnota
            Else
                bunka.Offset(0, 1) = hodnota
            End If
        End If
    End If
Next
End If
End Sub


-- 
s pozdravom
AleXXX

Remember: there are no strangers in the world,
only friends who have not yet met.



This archive was generated by hypermail 2.1.2 : 20. 05. 2002, 14:40 CEST