+ Reply to Thread
Results 1 to 13 of 13

Help with Tag Cloud

  1. #1
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Help with Tag Cloud

    Greetings to everyone!

    I found a thread that describes and solves exactly what I am looking to do but I can't make it work for some reason...Most likely because it has been sometime since I was asked to do any coding.

    here is what I posted in the original thread:

    I know this is an older post but it is exactly what I am looking to do with some research I have completed. I have an open ended response located in column B which I would like to do the word count on and then create a word cloud.

    My problem stems from my long absence from coding and I can't seem to get everything to work.so my question is; how do I get the second piece of code to run on the set of cells (column b) and then have the chandoo code run?

    I have attached a snippet of the responses from the survey.

    any help would be greatly appreciated

    Thank you


    Thank you for any help that you can give.
    Attached Files Attached Files
    Last edited by williajc; 12-05-2010 at 08:08 PM.

  2. #2
    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: Help with Tag Cloud

    Try this:
    Please Login or Register  to view this content.
    Last edited by shg; 11-21-2010 at 08:58 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    Thank you! This looks like just what I need....
    But because I haven't been doing this for a long time how do I get it to run? I have the code saved in the worksheet and have that saved as a macro enabled excel sheet. I am just not sure of the next step to take.

    Thank you for all the help so far.

    John

  4. #4
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    Ok so I have figured out how to get the code to run but now I get an error:
    Complie Error:
    User-defined type not defined.

    Then the code sheet come up and after clicking 'OK' this line of code is highlighted yellow:

    Function UniqueWords(rInp As Range) As Variant

    Thanks for you help as always.

    John

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Tag Cloud

    Hi John

    I'm only interjecting because I see that Shg is off-line and I'm interested in the outcome of your exercise (please post your final code when done!)

    Set a reference to Microsoft Scripting Runtime...in VBA Tools-->References-->Microsoft Scripting Runtime.

    This should fix this issue
    Compile Error:
    User-defined type not defined.
    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    Thanks Jaslake,

    I made the change you suggested but now I get the following error:

    Object variable or With block variable not set.

    now when I click the ok button it sends me back to the sheet.

    Any Ideas?

    edit:
    And yes I will be happy to post the code that ultimately works

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Tag Cloud

    Hi John

    The procedure runs fine on my machine. What line of code throws the error? Do you know how to step through the code? If not, put your cursor in Sub Main then tap F8; this will "Step Through" the code line by line. It'll lead you to the line that is causing the error.

    Alternately, run the code. When it halts, select debug. The offending line will be highlighted.

    Hopefully Shg will be back tonight. I'll try to help in his absence. Don't pretend to know or understand the code.

    John

  8. #8
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    I really appreciate the help...

    when I step through it the error occurs here:

    For Each cell In rInp.Cells
    sInp = cell.Value

    it steps from the For statement going to the sInp and errors there.

    I am obviously not great at this code thing either...still trying to pull what little knowledge i had from the cobwebs of my mind.

    Thanks again,
    John

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Tag Cloud

    Hi John

    Are you running this code on the sample workbook you posted in your thread? If not, run on your sample and see what happens. The sample is a controlled environment and, on my platform, the code steps right through that line.

    If you're running on a different sample, you'll need to post that.

    John

  10. #10
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    jaslake,

    I am using an extended version of the spreadsheet. I have attached it and the code here...Thanks for all your help.
    Attached Files Attached Files

  11. #11
    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: Help with Tag Cloud

    See attached. There was a Name error in a cell that was causing it to hang. Also, the code should be in a code module, not a sheet module.

    Jaslake, thanks for stepping in to help.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-01-2008
    Location
    Ohio
    Posts
    16

    Re: Help with Tag Cloud

    OMG! Thank you SHG and Jaslake You two are the best....

    One question I have:
    Why would it need to be in a code module? is it because it affects two different sheets?

    thanks again!

  13. #13
    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: Help with Tag Cloud

    Because the code in sheet modules and ThisWorkbook should be there to handle worksheet and workbook events, not to perform processing relevant to the application.

+ 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