|
-
Jan 19th, 2007, 08:56 PM
#1
Thread Starter
Junior Member
retrieving excel row height
VB6
have an excel sheet open, all works well.
I want to retrieve the height of a row and i cant seem to find any function to do it
more precisely i want to do something like
VB Code:
For i = 1 To range.rows.count
Msgbox worksheet.row(i).height
Next i
only problem is worksheet.row doesnt have an index or any properties... nor does anything else i have been able to find.
Thanks
-
Jan 19th, 2007, 11:08 PM
#2
Re: retrieving excel row height
Its based upon a Range object.
VB Code:
With Worksheets("Sheet1").Rows(1)
MsgBox .RowHeight
End With
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 20th, 2007, 11:18 AM
#3
Addicted Member
Re: retrieving excel row height
RobDog888 is right, it's based on the Range object.
The object browser is your best friend when it comes to stuff like this. If you have the referenced checked for excel in your VB project, then you can press F2 to view the object browser. You'll see a combo box that says "<All Libraries>". Select "Excel" from the combo box to see all the classes of Excel. In the classes listbox select "Range" and in the "Members of 'class' " listbox you'll see all the Range's properties, methods, collections, etc. You'll find RowHeight in there. Much easier to navigate in there rather than Intellisense.
-
Jan 20th, 2007, 01:13 PM
#4
Re: retrieving excel row height
more precisely i want to do something like
visual basic code:--------------------------------------------------------------------------------
For i = 1 To range.rows.count
Msgbox worksheet.row(i).height
Next i
Hi
To find rowheight of all the rows in the range use Rob's code in your loop i.e
VB Code:
For i = 1 To range.rows.count
With Worksheets("Sheet1").Rows(i)
MsgBox .RowHeight
End With
Next i
Hope this helps...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jan 29th, 2007, 01:38 PM
#5
Thread Starter
Junior Member
Re: retrieving excel row height
well actually this issue is resolved now but not by using the .rowheight property
in excel you can resize rows, so some rows might be different heights than others. as far as i can see .RowHeight returns the average or the default row height.
to get it to work i used some command like row(i).height... but im not on the same computer i coded it in... i'll post my code later
-
Jan 29th, 2007, 03:08 PM
#6
Re: retrieving excel row height
No it doesn't. Rowheight returns the height of the row corresponding to the range you passed. If you pass it a single row, then it will return the height of that row.
But at least it is working now.
zaza
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|