+ Reply to Thread
Results 1 to 20 of 20

Merge Text into HTML Template all within Excel

  1. #1
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Merge Text into HTML Template all within Excel

    Hi, I wonder if anybody is able to help, I have a CSV file with a couple of coloumns of data (text & url) that needs inserting into another cell that contains HTML. The data needs to be inserted within a certain part of the HTML. First of all, is this possible? And could somebody direct me in the correct direction? I am no expert in Excel or programming so please go easy! Many thanks in anticipation.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    hi carbitz, welcome to Excelforum, it's possible, it would be helpful if you post files and explanations

  3. #3
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, i have created a dummy file which will hopefuly give you a better idea of my problem.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    I should have said, I want to insert data from columns A, B, and C into a certain part of the html in D. Any queries, please let me know. many thanks

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    where should the data go in HTML template string?

  6. #6
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    hi, the title should go after "<!--Title-->"

    the description should go after "<p>Test Description</p>"

    the photo url should go after "<!--Pictures--> "

    I have updated the file a little as i don't think on the previous version the full html copied over.

    many thanks
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    please check attachment, press Run button
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, many many thanks for this, exactly what I wanted!

    Over the weekend i have been trying to amend this as i have another variable to include and i have been trying to play with the formulae in VB. I have not succeeded! Are you able to point me in the right direction please?

    It will mean including an additional column between photo url and html template. many thanks for all your help, it is very much appreciated.

  9. #9
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Anybody help with this? thanks

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    please check attachment, cell E2
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, many thanks for your help.

    I tried to be a bit clever and was hoping to transfer the macro you formulated for me and assign it to my own spreadsheet which I have failed to do, miserably!

    I have therefore now included the actual spreadsheet and I am hoping you can do the same for this. I think trying to work and write with VB is way beyond me, and I can only hope you are able to help me with this.

    I have included the spreadsheet with the various variables i would like below.

    If there are any questions or you require any clarifications, please ask and thank you very much in advance.

    Title (Column H) to be inserted within the html (Column - AI) replacing 'TITLE HERE'
    Condition (Column A) to be inserted within html (Column - AI) replacing 'CONDITION HERE'
    Part/Model Number (Column B) to be inserted within html (Column - AI) replacing 'PART NUMBER HERE'
    Description (Column C) to be inserted within html (Column - AI) replacing 'DESCRIPTION HERE'
    Photographs URL (Column D) to be inserted within html (Column - AI) replacing 'PICTURES HERE) - It would be great if more than one image could be inserted here, perhaps separated by commas etc, also if the image could be centred on the page.

    template.xlsx

  12. #12
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    please check attachment, run code "test". I did not understand the photo remark for multiple images.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, many thanks for this it is working like a dream!

    The only issue i have is the photo element will be a link to a photo hosted elsewhere, so will be in a format like '[IMG]http://*****.jpg[/IMG]'

    What I would like to do is insert the code for the photo in column D. I would also like the option to include 2 or more links for multiple photo's if this is possible, all within one cell.

    Many thanks, your help is very much appreciated.

  14. #14
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    do I understand you correctly:
    1. Cell may have 1 link:
    http://*****.jpg
    or multiple links (separated by coma):
    http://*****.jpg, http://*****.jpg, http://*****.jpg
    2. If it's one link it would go into a template as [IMG]http://*****.jpg[/IMG]. What would be format for multiple links?

  15. #15
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, yes that is correct, If it is possible to separate by commas that would be great, if it needs to be separated by something else that is also fine. Sometimes I will have one image, but there may be times where I need two or three or four images etc

  16. #16
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    please check attachment, photo links are seperated by semicolon, run code "test"
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, thanks for that, I can't seem to get it working, the format I use for the pictures is ....<a href="http://media.photobucket.com/image/bokeh/nikkikiwiii/A_Cup_of_Bokeh__please__by_smanimag.jpg?o=4" target="_blank"><img src="http://i467.photobucket.com/albums/rr37/nikkikiwiii/A_Cup_of_Bokeh__please__by_smanimag.jpg" border="0"></a>.....

    Am wondering if i gave you an incorrect format?

    many thanks

  18. #18
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    please check attachment, run code "test"

    Photo links are seperated by semicolon. If I understood correctly href value and image source will be the same link address
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    09-29-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Merge Text into HTML Template all within Excel

    Hi, many thanks for all your help, i have been using the template and it is working great, I think you have finally sorted this problem for me. There is one question, when i include photographs (pictures here), it only allows me to include three pictures. Is there anyway i can include as many pictures as i want to?

  20. #20
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge Text into HTML Template all within Excel

    can you post a sample file supporting this problem?

+ 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