+ Reply to Thread
Results 1 to 6 of 6

VBA: Pasting data into excel that may contain an "

  1. #1
    Registered User
    Join Date
    03-22-2010
    Location
    Swansea, South Wales
    MS-Off Ver
    2016
    Posts
    10

    VBA: Pasting data into excel that may contain an "

    Morning - hoping someone can point me in the right direction.

    I have a very simple vba script that takes 2 worksheets and compares them, looks for differences, all is good.

    The data is coming from an SQL database.

    The problem i have, is sometimes one of the cells in SQL contains just a "

    If this happens, as expected the rest of the cells all get pasted in wrongly into 1 cell as its expecting a string i guess.

    I have the cells set as Text in the cell formatting, this doesn't help.

    Any idea, or is this just not possible?

    Cheers!

    Kev

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,008

    Re: VBA: Pasting data into excel that may contain an "

    Post your code
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-22-2010
    Location
    Swansea, South Wales
    MS-Off Ver
    2016
    Posts
    10

    Re: VBA: Pasting data into excel that may contain an "

    I can, but the issue isn't running any code (not sure why it was moved into this section), the issue is a simple pasting of data into a sheet, at this point there is no code running at all

  4. #4
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: VBA: Pasting data into excel that may contain an "

    can you please upload the sample workbook with your code, this will help in understanding the query better
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  5. #5
    Registered User
    Join Date
    03-22-2010
    Location
    Swansea, South Wales
    MS-Off Ver
    2016
    Posts
    10

    Re: VBA: Pasting data into excel that may contain an "

    There isnt really anything to upload, if you take a blank workbook and paste data which contains " in the cells, it happens.

  6. #6
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013
    Posts
    388

    Re: VBA: Pasting data into excel that may contain an "

    It was moved to this section because of the Title - VBA: Pasting data into excel that may contain an " and that you say you're using a VBA Script.

    The problem is, we don't / can't see the data being pasted in - We can't recreate your data because we don't know anything about other than it comes from an SQL Query.

    We can't just pick a random sample of data that we use and expect it to in anyway correlate to your problem

    You need to provide some kind of example of the Data and how it is being pasted in.

    What part does the VBA Script you mention play in any of this?

    What does the data look like in it's raw form?

    Are you just copying and pasting from some database program?

    Are you exporting it as CSV (or some other kind of file) and then copying and pasting?

    Are you using the Text Import Wizard to get the data into Excel?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Remove a cell containing specific duplicate text "", then pasting results
    By Logical999 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-23-2018, 04:32 PM
  2. Replies: 1
    Last Post: 05-16-2017, 09:33 AM
  3. [SOLVED] Syntax to check names in outlook after pasting adresses into "To" line
    By kappa0815 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2016, 08:51 AM
  4. [SOLVED] Pasting values between ranges in different workbooks: "Range" works but "Cells" doesn't
    By Flaubert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2013, 01:19 PM
  5. Opening 4 excel files, copying set table data and pasting into "master file".
    By Belloni in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-29-2012, 09:50 AM
  6. [SOLVED] [SOLVED] Pasting data following the last " > " in a cell
    By Jim Jackson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2006, 11:30 AM
  7. How to automate "Excel data .. pasting to... powerpoint"
    By dstdst123@excite.com in forum Excel General
    Replies: 2
    Last Post: 02-23-2006, 11:55 AM

Tags for this Thread

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