Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2006, 08:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default Increase row height in Excel and multiple lines in

Does anybody know what the syntax is for increasing the height of a row of an Excel spreadsheet?

Let's say I want to increase cell A1. I am having a compile error. I have the following syntax:

With objectExcel
     .cell(1, 1).row.height.value = 14.5
     .cell [some more codes...]
end with

This is my first time using an Excel spreadsheet as an output file. Please help me out.

I also wanted to get the contents of the cell to wrap into more than one line. Ex.

I want the street in one line and the next line in the same cell will be the city, state and zip. What is the syntax or command for this?



Thanks,
jmss66

 
Old June 22nd, 2006, 11:31 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello jms66

    objectExcel.Rows("1:1").RowHeight = 30.75
    With objectExcel.Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With

I did'nt get any point on multiple lines. I guess, i saw was "Wrap Text"
and "shrink to fit". I say if you set row width and enable the Wrap text
it becomes and looks like its "multiple lines".

Anyway is just my thought.

hope this helps.

With Regards,
Raghavendra Mudugal
 
Old June 23rd, 2006, 03:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Thanks Raghavendra I will try and play with your code and see how I can make the "Wrap Text" work. Do you know any reference on the web or book I can buy so I can learn other syntax on Excel?

Thanks,
jmss66

 
Old June 23rd, 2006, 03:42 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello jmss66,

Actually, the best thing to learn is NO BOOKS, NO WEB LINKS.

Record a new macro, do what exactly you wanted to do to the CELL by changing
the properties font color whatever it can be..

afterwards, stop the macro.

Open the VBA editior of the excel from toolbar and see the code what it gave to
you. Then copy the code and put it under the excel object reference. IT WORKS !!!

This is what I do. Just consider this as a wizard to build the code what mouse/manual action you do.

Hope this helps.

With Regards,
Raghavendra Mudugal
 
Old June 23rd, 2006, 05:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Excellent suggestion. Thanks again for your help.

Cheers,
jmss66






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adjust row height of gridview wirerider ASP.NET 2.0 Basics 5 February 1st, 2008 07:01 AM
GridView and Row Height problem snufse ASP.NET 2.0 Basics 4 January 11th, 2008 02:29 PM
Fixed table height and row height rajanikrishna HTML Code Clinic 3 January 18th, 2007 12:42 AM
Fit the row height dinamically in a datagrid Lukas C# 1 June 7th, 2006 03:06 AM
Row Height aspadda Excel VBA 0 February 25th, 2004 03:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.