+ Reply to Thread
Results 1 to 10 of 10

Syntax

  1. #1
    Registered User
    Join Date
    10-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Syntax

    Trying to write a function for a datbase that pulls a product ID from column H and builds an HTML phrase to connect the entry to "More Info." I have made a very similar string work with images - but the characters in the html are causing me troubles. I just am not wrapping my head around the required syntax.

    Below is what I've written, the phrase should repeat over and over with the variable being what would be pulled in at &H54 (or whatever)

    Can you help? Thanks!

    =("<p><a href="http://www.davidsonsinc.com/consumers/subsites/inven_product.asp?dealer_id=320876&amp;item="&H54)&(" onclick="window.open(this.href, '', 'width=670,height=600');return false;" target="_blank">Click for more information</a></p>")

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,962

    Re: Syntax

    Hi and welcome to the forum

    Is this meant to be in the Excel general forum? It looks more like access - if so, I can move ity to that forum for you?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Syntax

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    Is this meant to be in the Excel general forum? It looks more like access - if so, I can move ity to that forum for you?
    I'm working in Excel. Life might be easier if I wasn't... But excel it is

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,962

    Re: Syntax

    OK then perhaps that's VBA? Because I dont recognise any regular formulas/functions in that

  5. #5
    Registered User
    Join Date
    10-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Syntax

    Na, I'm just being really bad at explaining myself. It doesn't help much when you need help. Lol. I'll try to do a better job:

    For example:

    In column A you have
    red
    green
    brown
    pink
    green

    In column b, for whatever reason you want excel to write a sentence for you with one variable:

    Jim likes teddy bears, but only ______ ones. They are his favorite.

    To do this you write:

    =("Jim likes teddy bears, but only"&A1")&" They are his favorite."

    The output in b1 is: Jim likes teddy bears, but only red ones. They are his favorite.
    and in b2 you get: Jim likes teddy bears, but only green ones. They are his favorite.

    and so on.

    It's just a text combination function.

    That's what I'm after with my previous post. I want it to treat the HTML like simple words. and combine it. Why? Well, its part of an inventory management system. I save it as a CSV file and when it gets imported, the program reads the text and handles what it sees as HTML input.

    So regarding this:

    <p><a href="http://www.davidsonsinc.com/consumers/subsites/inven_product.asp?dealer_id=320876&amp;item=ATIFX45MILTC" onclick="window.open(this.href, '', 'width=670,height=600');return false;" target="_blank">Click for more information</a></p>

    ATIFX45MILTC is the variable -- like the colors in my previous example. It comes from a column having a long list of product numbers.

    The first bit:

    <p><a href="http://www.davidsonsinc.com/consumers/subsites/inven_product.asp?dealer_id=320876&amp;item=

    would be just like "Jim likes teddy bears, but only"

    And this last part;

    " onclick="window.open(this.href, '', 'width=670,height=600');return false;" target="_blank">Click for more information</a></p>

    would be like "ones. They are his favorite."

    This works really well with the program I use. I use similar functions in other areas of my spreadsheet. When I cut and past new items in a column, all I have to do it drag the handle down on other columns.

    The problem is I don't know how to handle this particular bit because of the symbols and characters.

    This is one of those things that is really difficult to explain... at least for me

    How'd I do?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,962

    Re: Syntax

    OK well it sounds to me like you pretty much already know how to do what you want?

    ="<p><a href="http://www.davidsonsinc.com/consumers/subsites/inven_product.asp?dealer_id=320876&amp;item="&H54&" onclick="window.open(this.href, '', 'width=670,height=600');return false;" target="_blank">Click for more information</a></p>"
    that looks like it would work, based on your description - where H54 contains your "read/green" variables?

  7. #7
    Registered User
    Join Date
    10-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Syntax

    Not really. I can't sort out the syntax. I don't know how to make this work because of the symbols in the html - like equal signs, quote marks, etc. It's close, and I've tried using single quotes ' to get it to work... but I can't seem to sort it out. So I quess I was mostly looking for help on how to get excel to ignore certain pieces of text (as in not see them as part of a function) and keep the hine of html in tact for after it uploaded via CSV.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Syntax

    I can't help you enough with your HTML code.

    Maybe another approach is helpfull.

    Why not copy => paste special => values

    the text of column B into column C and use that (column C) for your HTML code.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,962

    Re: Syntax

    If you are working with "pieces" of text - either on their own, or somewhere in a string, then maybe we can put something together to ID those bits.

    Perhaps you can explain in a bit more detail where the data is coming ffrom etc?

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Syntax

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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. syntax help
    By TRJJK73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2009, 07:54 AM
  2. Syntax
    By adilhooda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2007, 07:11 PM
  3. [SOLVED] VBA syntax
    By Sunantoro in forum Excel General
    Replies: 1
    Last Post: 09-20-2005, 11:05 PM
  4. Syntax help please
    By GettingThere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2005, 09:05 PM
  5. [SOLVED] look up syntax
    By Pierre in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2005, 04:05 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