Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Import leaves "dirty" cells

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Importing from Access to Excel leaves blank cells. Only after clearing contents of the individual blank cells will the formulas work...some Excel KB articles refer to dirty cells...what can I do to globally clean the dirty cells.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,584
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    If the cells are "dirty" because they contain spaces, you can remove them by going to
    Edit, Replace, in the find-what box enter * then press your spacebar once. The replace-with-what box should be completely blank. You must ensure the box "find entire cells only" is selected. Click Replace All
    Hope this helps
    regards
    Derek

  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try running this macro to clean & trim the
    data cells

    Sub Clean_Trim()
    Dim CleanTrimRg As Range
    Dim oCell As Range
    Dim Func As WorksheetFunction

    Set Func = Application.WorksheetFunction

    On Error Resume Next
    Set CleanTrimRg = Selection.SpecialCells(xlCellTypeConstants, 2)
    If Err Then MsgBox "No data to clean and Trim!": Exit Sub

    For Each oCell In CleanTrimRg
    oCell = Application.WorksheetFunction.Clean(Func.Trim(oCell))
    Next


    End Sub


    Ivan

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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