Results 1 to 2 of 2

Thread: FlexGrid Vb6 to Excel - Format Cell

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2016
    Posts
    2

    Cool FlexGrid Vb6 to Excel - Format Cell

    Hi,

    I am trying to format a cell by using code on vb6. I have three cells but all I want to do is format the centre on to have wrap text active and set a height and with for it. Is there anyway I can alter the code below to do this?

    Code:
            For intCol = 1 To TheCols
                oSheet.Columns(intCol).AutoFit
                'wsXL.Columns(intCol).AutoFormat (1)
                oSheet.Range("a1", Right(oSheet.Columns(TheCols).AddressLocal, _
                                       1) & TheRows).AutoFormat GridStyle
            Next
    Thanks
    pmelia07

  2. #2
    Addicted Member Cristian's Avatar
    Join Date
    Jun 2006
    Posts
    228

    Re: FlexGrid Vb6 to Excel - Format Cell

    Maybe you have to autofit a full column o row like this:

    Range("A1").Select
    Columns("A:A").EntireColumn.AutoFit
    Rows("1:1").EntireRow.AutoFit

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width