+ Reply to Thread
Results 1 to 6 of 6

VBA to enter a formula, Compile Error

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    VBA to enter a formula, Compile Error

    I'm trying to enter a formula using a macro, and normally this works just fine, but for some reason excel hates me today. I know it has something to do with a quote missing or extra somewhere along the line, but there are a lot of quotes. I could use a second set of eyes!


    Please Login or Register  to view this content.
    The purpose of the macro is to generate a ton of SQL Queries for me. So it will convert:

    This is a "string", of text-with stuff's
    Into
    INSERT INTO Table1 VALUES('THISISASTRINGOFTEXTWITHSTUFFS')

    Thanks.
    Last edited by Speshul; 08-19-2014 at 10:08 AM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA to enter a formula, Compile Error

    Which characters are you trying to remove?
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: VBA to enter a formula, Compile Error

    These:

    [SPACE].-_/&^%[]:;#@$|(),'"

    Char Codes:
    32
    34
    35
    36
    37
    38
    39
    40
    41
    44
    45
    46
    47
    58
    59
    64
    91
    93
    94
    95
    124
    Last edited by Speshul; 08-19-2014 at 10:21 AM.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA to enter a formula, Compile Error

    maybe
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: VBA to enter a formula, Compile Error

    Perfect thanks.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA to enter a formula, Compile Error

    Have you considered using CHAR()?
    Please Login or Register  to view this content.

+ 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] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  2. [SOLVED] Sum formula in vba code giving compile error
    By kramtelbuab in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2013, 11:00 PM
  3. Excel 2007 : Compile error when inserting a formula
    By grsnipe in forum Excel General
    Replies: 3
    Last Post: 09-23-2011, 08:33 AM
  4. [SOLVED] formula array gives compile error
    By R..VENKATARAMAN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2006, 08:35 AM
  5. [SOLVED] VBAProject name compile error, not defined at compile time
    By Matthew Dodds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2005, 03:20 PM

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