Results 1 to 23 of 23

Thread: [RESOLVED] VB6 - Merge Cells in spreadsheet

Threaded View

  1. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    341

    Re: VB6 - Merge Cells in spreadsheet

    Hi Westconn1,
    Note: See current spreadsheet.
    I have been able to accomplish one of my objective - getting rid of spaces(non printable characters)in the "Comments" field with this code:
    Code:
    xlWksht.Cells(ii + 1, 1).Value = "Comments:" & Chr(10) & "'" & xlApp.Clean(Trim(rsin![Comments]))
    I also did some tweaking because of the "RunTime error 1004 unable to set the rowheight property of the range clas"

    However, it ran okay, but the row height is still very high.
    Is there any way to make the row height to fit the exact size of the data in the cell?

    Below is what I did to get it working so far:

    Code:
           
           With xlWksht.Range(Cells(ii + 1, 1), Cells(ii + 1, 8))
                .HorizontalAlignment = xlLeft
                .VerticalAlignment = xlTop
                .WrapText = True
                .Orientation = 0
                .IndentLevel = 0
                .MergeCells = True
                 MyRowHeight = .RowHeight * Len(xlWksht.Range("A" & CStr(ii + 1)).text) / w
                
                If MyRowHeight > 409.5 Then
                .RowHeight = 409.5 
                End If
           End With
    Thanks,
    GiftX
    Attached Files Attached Files

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