Re: Excel makro

From: Simona Trneckova (strnecka13@seznam.cz)
Date: 21. 05. 2002, 14:36 CEST


Dobry den
prosim o radu s timto makrem: Ten radek : ActiveCell.FormulaR2C2 =
"=VLOOKUP(RC[8],'sap (2)'!C[-1]:C[8],6,0)" se mi blokuje, pry "Object doesn't
support this property or method (Error 438)", ale kdyz pracuje tenhle:
ActiveCell.FormulaR1C1 = "=VLOOKUP(rc[8],ZAK!c[0]:c[1],2,FALSE)"
 tak sakrys cem je problem?

(A mimochodem, vsimnete si cestiny :-)) A to jsem jen dala copy v Excelu a
paste v seznamu.cz.. Tady je to cim?)

Sub startovni()
'
    Workbooks.Open FileName:="H:\Vzory\POKLAD.xls"
    Workbooks.OpenText FileName:="C:\TEMP\sap", _
    Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
    Array(Array(0, 2), Array(10, 4), Array(22, 2), Array(25, 4), Array(36, 2),
Array(87, 1), _
    Array(104, 2), Array(108, 9), Array(111, 1), Array(122, 9), Array(124, 1),
Array(135, 1), _
    Array(149, 9))
    Columns("A:J").Select
    Selection.Columns.AutoFit
    Sheets("sap").Move Before:=Workbooks("POKLAD.xls").Sheets(1)
    Sheets("sap").Select
    Sheets("sap").Copy Before:=Sheets(2)
    Sheets("sap").Select
    Range("A13").Select
    Selection.Sort Key1:=Range("A13"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Sheets("sap").Select
    Rows("1:100").Select
    Rows("1:100").EntireRow.AutoFit
    
        Columns("j").Select
        With Selection
        .HorizontalAlignment = xlRight
        End With
        

'vyzmizikovani nepotrebnych radku
        
              
        For R = 1 To 200
        If Cells(R, 1).Value = "CELKEM" Then
            Rows(R).EntireRow.Delete
            End If
        Next R
        
        For R = 1 To 200
        If Cells(R, 1).Value = "Číslo kart" Then
            Rows(R).EntireRow.Delete
            End If
        Next R
                    
        For R = 1 To 200
        If Cells(R, 1).Value = "Datum výka" Then
            Rows(R).EntireRow.Delete
            End If
        Next R
        
        For R = 1 To 200
        If Cells(R, 1).Value = "Podčíslo" Then
            Rows(R).EntireRow.Delete
            End If
        Next R
        
        For R = 1 To 200
        If Cells(R, 1).Value = "Tříděno dl" Then
            Rows(R).EntireRow.Delete
            End If
        Next R
                
        For R = 1 To 200
        If Cells(R, 3).Value = "---" Then
            Rows(R).EntireRow.Delete
            End If
        Next R


 'kontrola eliminovani nepotrebnych radku
 
    Sheets("Kontr").Select
    Range("b2").Select
    ActiveCell.FormulaR2C2 = "=VLOOKUP(RC[8],'sap (2)'!C[-1]:C[8],6,0)"
 
 'vlozit column
 
    Sheets("sap").Select
    Range("A1").Select
    Selection.EntireColumn.Insert
    
'a do a1 zakazku

    Sheets("sap").Select
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "=VLOOKUP(rc[8],ZAK!c[0]:c[1],2,FALSE)"

______________________________________________________________________
Reklama:
WWW stranky zdarma na http://www.sweb.cz



This archive was generated by hypermail 2.1.2 : 21. 05. 2002, 14:38 CEST