The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 number of rows in a col

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tschunck Posted - 01/23/2024 : 05:44:50 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin2024 (64-bit) 10.1.0.170
Operating System: Win10

Does anyone know how to get the number of rows in a specific [workbook]worksheet!col(X).
I don“t want to activate the worksheet and then use wks.maxrows because this takes a long time when hundred of worksheets have to be opened up in order to collect data. Instead I want to get the same information without activating the window.
5   L A T E S T    R E P L I E S    (Newest First)
hopkins2 Posted - 02/26/2024 : 11:47:29 PM
quote:
Originally posted by aplotnikov

quote:
For example, if you're using Python

This is actually a forum dedicated to Labtalk, not Python.



Alright, I understand your point.
aplotnikov Posted - 02/26/2024 : 05:36:01 AM
quote:
For example, if you're using Python

This is actually a forum dedicated to Labtalk, not Python.
hopkins2 Posted - 02/26/2024 : 05:18:54 AM
For example, if you're using Python with the openpyxl library, you can use the following code snippet:

python
Copier
from openpyxl import load_workbook

# Load the workbook
workbook = load_workbook('your_workbook.xlsx')

# Get the specific worksheet
worksheet = workbook['worksheet_name']

# Get the number of rows in column X
nrows = worksheet.max_row

# Print the result
print(nrows)
By using this method, you can directly retrieve the number of rows in the specific column without activating the worksheet or opening each individual worksheet. This approach significantly reduces the processing time when dealing with a large number of worksheets.
tschunck Posted - 01/23/2024 : 10:35:51 AM
Works great.
Thanks!
ChaoC Posted - 01/23/2024 : 10:08:43 AM
Hello,

You can use range notation. E.g.

range aa = [Book]Sheet!Col(X);
nrows = aa.getSize();

Best,
Chao

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000