+ Reply to Thread
Results 1 to 11 of 11

Editing existing macro help

Hybrid View

ad9051 Editing existing macro help 05-04-2011, 09:10 AM
realniceguy5000 Re: Editing existing macro... 05-04-2011, 10:07 AM
ad9051 Re: Editing existing macro... 05-04-2011, 10:15 AM
realniceguy5000 Re: Editing existing macro... 05-04-2011, 01:39 PM
ad9051 Re: Editing existing macro... 05-07-2011, 01:03 AM
realniceguy5000 Re: Editing existing macro... 05-09-2011, 09:00 AM
ad9051 Re: Editing existing macro... 05-09-2011, 04:40 PM
realniceguy5000 Re: Editing existing macro... 05-10-2011, 07:39 AM
ad9051 Re: Editing existing macro... 05-11-2011, 03:41 PM
realniceguy5000 Re: Editing existing macro... 05-11-2011, 04:51 PM
ad9051 Re: Editing existing macro... 05-11-2011, 07:07 PM
  1. #1
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Editing existing macro help

    Hello, firstly many thanks for taking the time to look at my problem. I previously created a psuedoproblem, with an example of what i would like returned in the attatched excel doc. This psuedoproblem that was solved by Excel forum moderator "Leith Ross" and the button attatched macro works perfectly. Unfortunately due to not completely understanding this macros coding i have been unable to edit it to fit my needs (yes i should have supplied a more representative problem.) My Hope is that someone might be able to help me edit this code to work for the representitve example stating in row 110 of this page.

    Any help provided will be gretly appreciated.

    Many Thanks Alan
    Attached Files Attached Files
    Last edited by ad9051; 05-12-2011 at 12:04 PM.

  2. #2
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Editing existing macro help

    Hi, I have tried some modifcations based on your test book.

    You can test the example book I posted and see how it looks when you press the button.

    Let us know, Thank You Mike.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Editing existing macro help

    Hello Mike many thanks for the help, It doesnt work 100%,in the example/macro you provided it inputs the target word in colomn C. Where as for the representative data (row 110 onward) it needs to input in colomn D. It doesnt matter if the macro messed up the non representative data, as this was only provided to show how the first macro provided worked.

    Hope that makes sence.

    Many thanks

    Alan

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Editing existing macro help

    Hi, Try this updated version.

    Let me know.

    Thank You,
    Mike
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Editing existing macro help

    Hello real nice guy, amazing work! Love it, is there anyway you can simplify it so that it doesnt do the top data (the top data was provided purly to show what data the orignal macro had been programmed to work for.)

    I have reattatched a spreadsheet with only the data that is representative of my problem.

    Many many thanks,

    Alan
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Editing existing macro help

    Ok...

    Lets try again, let me know how this works for you...

    Just press the button on the page.

    Thank You, Mike
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Editing existing macro help

    Hello RealNiceGuy, many thanks i have opened the macro that is used in the provided document. I notice that the "title pulling" is triggered after recognition of the word "Target." Or at least this is how i understand it. If this is the case, this will not work for my actual spreadsheet, as these words represent different words each time. I thought the generic "target word" would make this obvious I was hoping that recognition of this cell would be achieved by knowing that the cell 3 down/1 to the right would be "Title."

    Also the target word is more of a target phrase, in that it may be multiple words and even contain brackets. But it will always be separated from the Miscellaneous junk text by greater than 5 spaces. :S Is it possible to recognise this as the end of the "Target Word"

    I have seen coding recognising patterns in next before. (Simply wish I knew what it meant) See example below.

    Sub snb()
        ReDim sn(6)
        
        c00 = [A38]
        sq = Split(c00)
        
        sn(0) = sq(0)
        sn(1) = Trim(Replace(Split(c00, "(")(0), sn(0), ""))
        sn(2) = Join(Filter(Filter(sq, "("), "+", False), "")
        sn(3) = Join(Filter(sq, "+)"), "")
        sn(4) = Trim(Split(Split(c00, sn(3))(1), "-")(0))
        sn(5) = Trim(Split(Split(Split(c00, sn(3))(1), "-")(1), "£")(0))
        sn(6) = Join(Filter(sq, "£"), "")
        
        Cells(40, 4).Resize(, 7) = sn
    End Sub
    Many thanks Alan

  8. #8
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Editing existing macro help

    Hi Alan,

    See how this modifcation works for you, Keep me posted.

    Thank You, Mike
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Editing existing macro help

    This code seems to do everything I want, but I have since found that it doesn't seem to exclusively look for if 3 rows down one column to the right = "title" If you look in the attachment i have edited one of the titles which also contains formatting similar to the "target word." It seems to then recognise this as the target object despite the cell 3 down, 1 to the right not being "title."

    The attached spread displays this problem better than I can explain it.

    I do believe this will be the final hoop through which we will be needing to jump, as manually moving these false targets one cell to the right makes it work perfectly on my real spread.

    Cant thank you enough, (obviously your reputation will be amended as such)

    All the best

    Alan

    p.s.

    I have highlighted the cells which cause the macro to not work, interesting to note it only causes this undesired effect if the highlighted erroneous cells are two cells below a new "targetword"
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Editing existing macro help

    Ok Alan I corrected that issue as well I did see where you change the script to 7 col over, to test I changed it back to the 4th col so you can see what the data looks like when the button is pressed.

    You know the drill keep me posted.

    ...
    Attached Files Attached Files
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  11. #11
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Editing existing macro help

    Its too easy to say but realniceguy, your a real nice guy. Many thanks for the help, problem solved. And reputation boosted for sure!

    Cant thank you enough

    Alan

+ 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