Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What row am I on
Message
From
12/07/2001 07:45:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00529435
Message ID:
00529614
Views:
9
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform