Jump to content

get last non-empty row - Excel


Jfish
 Share

Go to solution Solved by water,

Recommended Posts

Right, that worked.  Also, getting back to the OP ... this will find the last used cell in a range:

$LastRow = $oWorkbook.ActiveSheet.Range("A1").SpecialCells($xlCellTypeLastCell).Row
MsgBox("","",$LastRow)

The constant for that is also in the UDF.  I think that would also be a great add as a function ,,,

EDIT: Warning this is still a great method but if anyone wants to use this method you must save before calling because .SpecialCells(xlCellTypeLastCell) is only recalculated when the sheet is re-saved.

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

I think I will add some examples of range selection to the wiki.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I started with the wiki.

What do you think?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Water -

I think what you posted on the wiki is very useful.  I agree with the idea of the focus on range selection because that is probably the trickiest part.  From there, users can do all sorts of things.  I would consider adding some simpler examples to compliment the ones you already have.  Select a range with and without variables.  For a default sheet, for a specific named sheet, etc.  I say that because if you knew nothing about it and looked at the examples (which are great) you may learn some of the less intuitive selections but still may not walk away with the practical everyday examples.  Also, consider that the help file does not completely document them either because the complexity is hidden by the functions that do most of those things for the user.

I know this is a bit off topic but it may also be good to document some of the other constants somewhere that are available in the UDF but not part of the help file.  Example from the above thread: $xlCellTypeLastCell.  Since these are already part of the include it would be useful to know some of the things they can do (or maybe they are already documented somewhere?).

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

Thanks for the comments.

It's not easy to know where to start and where to end.Adding too much information and examples to the wiki will again leave users unsatisfied.

I think we can expect a little bit of knowledge of Excel and Autoit before a user starts to automate Excel.

To best use my limited spare time I'm going to expand the wiki based on user queries. If the question sounds to be sensible for others too I will add the answer to the wiki.

OTH the wiki is free for everyone to modify ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

×
×
  • Create New...