+ Reply to Thread
Results 1 to 2 of 2

Weird issue with cell spacing

Hybrid View

  1. #1
    Rishi Dhupar
    Guest

    Weird issue with cell spacing

    Hi,

    I am trying to write cell values to a WS from VBA. I am trying to add
    line feeds with Chr(10) to the cell if I will be adding more then 1
    item to the same cell. I keep getting these random big spaces above
    the text (Click the picture below for a better understanding). I try
    to autofit the row, still won't shrink it down, and there is other then
    what is being displayed. Here is my code.

    'If data exists then concatanate
    If LenB(findRange.Offset(0, ft + 1).Value) > 0 Then
    findRange.Offset(0, ft + 1).Value = findRange.Offset(0, ft +
    1).Value & Chr(10) & _ Format(cellRow.Columns(colPCCBFinal).Value,
    "m/dd/yyyy") & _ cellRow.Columns(colRevNum)
    Else
    findRange.Offset(0, ft + 1).Value =
    Format(cellRow.Columns(colPCCBFinal).Value, "m/dd/yyyy") & " " &
    cellRow.Columns(colRevNum)
    End If

    http://img137.imageshack.us/img137/4143/excel1aq.jpg


    Thanks,
    RishiD


  2. #2
    Jim Rech
    Guest

    Re: Weird issue with cell spacing

    Regrettably Excel is a little weird this way. Good answer?<g> Well, I can
    reproduce the same effect manually. You just have to make the column width
    a little wider even if it looks like there is enough room currently.

    --
    Jim
    "Rishi Dhupar" <[email protected]> wrote in message
    news:[email protected]...
    | Hi,
    |
    | I am trying to write cell values to a WS from VBA. I am trying to add
    | line feeds with Chr(10) to the cell if I will be adding more then 1
    | item to the same cell. I keep getting these random big spaces above
    | the text (Click the picture below for a better understanding). I try
    | to autofit the row, still won't shrink it down, and there is other then
    | what is being displayed. Here is my code.
    |
    | 'If data exists then concatanate
    | If LenB(findRange.Offset(0, ft + 1).Value) > 0 Then
    | findRange.Offset(0, ft + 1).Value = findRange.Offset(0, ft +
    | 1).Value & Chr(10) & _ Format(cellRow.Columns(colPCCBFinal).Value,
    | "m/dd/yyyy") & _ cellRow.Columns(colRevNum)
    | Else
    | findRange.Offset(0, ft + 1).Value =
    | Format(cellRow.Columns(colPCCBFinal).Value, "m/dd/yyyy") & " " &
    | cellRow.Columns(colRevNum)
    | End If
    |
    | http://img137.imageshack.us/img137/4143/excel1aq.jpg
    |
    |
    | Thanks,
    | RishiD
    |



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1