Jump to content
Sign in to follow this  
DCCD

[SOLVED] - Get Rows # by horizontal page breaks!?

Recommended Posts

DCCD

[solved]

; Return the last row # of each page
.ActiveSheet.HPageBreaks(1).location.rowoÝ÷ Ù«­¢+ØìIÑÕɸѡ!A  ɭ̽±±Ñ¥½¸(¹Ñ¥ÙM¡Ð¹!A  ɭ̹
½Õ¹

I want to know the number of the last row of each page, I know its possible but how?

One more question?, Somehow can't find the ExcelUDF where to find it? i try to search for it, it doesn't appear :D

post-30451-1244948590_thumb.jpg

Any Help will be highly appreciated,

Thanks in advance

Edited by DCCD

Share this post


Link to post
Share on other sites
BugFix

Hi,

try this:

Local $sFilePath = 'your.xls'
Local $oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 1    ; 1=visible / 0=unvisible
Local $oBook = $oExcel.WorkBooks.Open($sFilePath, Default, False)
Local $oSheet = $oBook.Worksheets.Item(1)  ;  <=== number/name of sheet you wish
Local $maxRows = $oSheet.UsedRange.Rows.Count
ConsoleWrite('maxRows: ' & $maxRows & @CRLF)
Edited by BugFix

Best Regards BugFix  

Share this post


Link to post
Share on other sites
Zedna

One more question?, Somehow can't find the ExcelUDF where to find it? i try to search for it, it doesn't appear :D

From Autoit version 3.3 it's standard include:

"C:\Program Files\AutoIt3\Include\Excel.au3" 

Edited by Zedna

Share this post


Link to post
Share on other sites
DCCD

Hi,

try this:

Local $sFilePath = 'your.xls'
Local $oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 1    ; 1=visible / 0=unvisible
Local $oBook = $oExcel.WorkBooks.Open($sFilePath, Default, False)
Local $oSheet = $oBook.Worksheets.Item(1)  ;  <=== number/name of sheet you wish
Local $maxRows = $oSheet.UsedRange.Rows.Count
ConsoleWrite('maxRows: ' & $maxRows & @CRLF)
thanks BugFix, but "UsedRange" it just appears my LastCell number!

I want to know the number of the last row of each page?

Ex:

Page1 :pagebreak1 = row number?

Page2 :pagebreak2 = row number? etc..

From Autoit version 3.3 it's standard include:

"C:\Program Files\AutoIt3\Include\Excel.au3" 

Thank you, I upgrade to last version

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×