+ Reply to Thread
Results 1 to 3 of 3

Using String Variable in VBA if Formula

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Using String Variable in VBA if Formula

    Hi There,

    I am assigning a string to variable in my VBA code. I need to pull this value again in if formula. The code is looking like this.

    Please Login or Register  to view this content.
    This is resolving the value of existing in the formula i.e. in the cell I am getting =if(condition, Test1, "Not Defined"). The problem is that after resolving the name it is not adding " " in the formula. All I need is that when this formula get resolved it should give me =if(condition, "Test1", "Not Defined")

    Thanks in advance
    Last edited by Cutter; 08-29-2012 at 09:12 PM. Reason: Added code tags

  2. #2
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Using String Variable in VBA if Formula

    try:

    Please Login or Register  to view this content.


    ---------- Post added at 03:10 PM ---------- Previous post was at 03:09 PM ----------

    Please see forum rules http://www.excelforum.com/forum-rule...rum-rules.html. Add Code tags to your post
    Regards,
    Vandan

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    Excel 2007 - excel 2010
    Posts
    1

    Re: Using String Variable in VBA if Formula

    Works fine for me thx

+ 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