+ Reply to Thread
Results 1 to 7 of 7

Thread: Equals updates only part of a cell

  1. #1
    Registered User
    Join Date
    03-11-2010
    Location
    Bristol UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Equals updates only part of a cell

    If I have a long string inside of a cell, lets say

    UPDATE gtdb set camelot = '7A' WHERE major_key = 'D Minor'

    Can I have excel use the Equals function on only part of the string? like this

    (D Minor) = A13

    Thanks for your help

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372

    Re: Equals updates only part of a cell

    There are a whole slew of Functions (e.g. LEFT, RIGHT, MID) which can be used to return part of a text string. The question is, what do you want to tell Excel to return. An example workbook in which you show what you have and what you want would make this easier.
    ChemistB
    My 2¢

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  3. #3
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Equals updates only part of a cell

    maybe like this

    ="UPDATE gtdb set camelot = '7A' WHERE major_key = "&A13

  4. #4
    Registered User
    Join Date
    03-11-2010
    Location
    Bristol UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Equals updates only part of a cell

    Quote Originally Posted by ChemistB View Post
    There are a whole slew of Functions (e.g. LEFT, RIGHT, MID) which can be used to return part of a text string. The question is, what do you want to tell Excel to return. An example workbook in which you show what you have and what you want would make this easier.


    I want only a part of the Cell B1 to equal Cell A1

    Example
    Cell A1 Cell B1
    "Something" "Cell A1 has 'Something' in it"

    As you can see I want only part of cell B1 to equal cell A1

  5. #5
    Registered User
    Join Date
    03-11-2010
    Location
    Bristol UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Equals updates only part of a cell

    Quote Originally Posted by teylyn View Post
    maybe like this

    ="UPDATE gtdb set camelot = '7A' WHERE major_key = "&A13
    That nearly got it but it left out the single quote marks.
    your code gave me: UPDATE gtdb set camelot = '7A' WHERE major_key = 6B
    But i would like 6B inbetween single quotes like this:
    UPDATE gtdb set camelot = '7A' WHERE major_key = '6B'

    I think I may have reached the limitation???

    Thanks a lot for your help guys

  6. #6
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: Equals updates only part of a cell

    Just add the single quotes into the string then:

    ="UPDATE gtdb set camelot = '7A' WHERE major_key = '"&A13&"'"

  7. #7
    Registered User
    Join Date
    03-11-2010
    Location
    Bristol UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Equals updates only part of a cell

    Quote Originally Posted by Paul View Post
    Just add the single quotes into the string then:

    ="UPDATE gtdb set camelot = '7A' WHERE major_key = '"&A13&"'"
    Thanks,

    that almost got it I ended up with single quotes on one side and double on the other, but i changed it to this and now it does what I want it to
    ="UPDATE gtdb set camelot = '"&B2&" WHERE major_key = '"&A2&""
    that renders out this:
    UPDATE gtdb set camelot = 'A-Flat Minor' WHERE major_key = '1A'


    Confusing really as I only have 2 single quotes in the code and it pumps out four!???
    Just how I need it.

    Thanks alot for sorting me out guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0