Link to home
Start Free TrialLog in
Avatar of spitcha
spitcha

asked on

Excel .end(xlUp) fails

The sub writes messages in Outlook to an Excel file. I need the script to select to lastRow in the excel file but the line "rInt = xlWks.Range("A65536").End(xlUp).Row" errors.
ol-xl-error.txt
Avatar of nutsch
nutsch
Flag of United States of America image

dim rInt as a long instead, you probably have more than the 32 some thousands supported by the integer data type.
Avatar of spitcha
spitcha

ASKER

Thanks for the reply. I get the same error after changing rInt to long
Avatar of Flyster
See if this will work:

rInt = .Cells(.Rows.Count, "A").End(xlUp).Row

Flyster
Avatar of spitcha

ASKER

Nope. Still getting the same error.
Avatar of spitcha

ASKER

The issue is with end(xlUp). I'm able to select or get any value, leaving this query out.
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spitcha

ASKER

Adding this line fixed the issue.
Thanks much!