+ Reply to Thread
Results 1 to 5 of 5

Adding Data to a Cell

  1. #1
    Registered User
    Join Date
    07-05-2006
    Posts
    59

    Adding Data to a Cell

    Here's the scoop:

    I have a column of cells (say column B) that have various information in it. Additionally, some cells are blank. What I need to do is add a quotation mark at the beginning and end of the data in each cell.

    For example, row 2 may have abc123 inside of it, row 3 empty and row 4 may have 001234. I need say a macro to change these cells with data to read:

    "abc123"
    "001234"

    All blank cells must remain blank.

    I tried to think of a way to use the Find/Replace option but because the data varies it won't work.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Try this, hope it helps

    Please Login or Register  to view this content.
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  3. #3
    Registered User
    Join Date
    11-25-2005
    Posts
    19
    Try this

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-25-2005
    Posts
    19
    sorry, the code before mine works as well, it must have gotten posted shortly before I posted mine. Both should work for you.

  5. #5
    Registered User
    Join Date
    07-05-2006
    Posts
    59
    Thanks guys for the help. I tried the first one and it worked perfect. I would have responded sooner but I was in a time crunch to get things finished up.

+ 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