Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What row am I on
Message
De
12/07/2001 07:45:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/07/2001 16:39:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00529435
Message ID:
00529614
Vues:
11
>Hi all,
>
>I am trying to find out what the last row reference is used in excel, I know I can use lastcell to go to the last cell, but how do I find out what row it is?
>
>Thanks

Iain,
You don't need to go there. Or if you want to go first you should find out where to go :)
#Define xlR1C1 -4150
#Define xlLastCell  11

lcXLS = getfile('XLS')
oExcel = createobject("Excel.application")
With oExcel
  .WorkBooks.Open(lcXLS)
  With .ActiveSheet
    ? 'Used Range - xlA1    Absolute : '+.UsedRange.Address
    ? 'Used Range - xlR1C1  Absolute : '+.UsedRange.Address(,,xlR1C1)
    ? 'Used Range - xlA1    Relative : '+.UsedRange.Address(.f.,.f.)
    ? 'Used Range - xlR1C1  Relative : '+.UsedRange.Address(.f.,.f.,xlR1C1)
    ? 'A1 - Relative                 : '+.Range("A1").Address(.f.,.f.,xlR1C1)
    ? 'Cont.Region - xlA1   Absolute : '+.Range("A1").CurrentRegion.Address
    ? 'Cont.Region - xlRC   Absolute : '+.Range("A1").CurrentRegion.Address(,,xlR1C1)
    ? 'Last Cell - xlA1   Relative   : '+.Range("A1").SpecialCells(xlLastCell).Address(.f.,.f.)
    ? 'Last Cell - xlR1C1 Relative   : '+.Range("A1").SpecialCells(xlLastCell).Address(.f.,.f.,xlR1C1)
    ? 'Last Cell - xlA1   Absolute   : '+.Range("A1").SpecialCells(xlLastCell).Address
    ? 'Last Cell - xlR1C1 Absolute   : '+.Range("A1").SpecialCells(xlLastCell).Address(,,xlR1C1)
    .UsedRange.Select
    ? 'Selection - Absolute          : '+.Application.Selection.Address
  Endwith
  .visible = .t.
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform