+ Reply to Thread
Results 1 to 10 of 10

Find function problem

  1. #1
    Registered User
    Join Date
    11-24-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Find function problem

    Below is the section of code that I am having problems with. I've got a table of data which i am trying to manipulate onto another sheet in a presentable form to customers. Depending on the header of the column I would like the corresponding value to go in one of two columns. If the header contains 'freq' in the title, (not all are just freq, there are other headers containing that string as well) then I want it to go one side, if it does not then it needs to go on the other.

    I have an array with the data, am able to get the function to look at the headers, but the .find function does not seem to return 'True' when the string is present, it just returns all searches as false.

    I hope that makes sense, if anyone has any ideas it would be hugely appreciated.

    Apologies for confusing use of variables for colNumber and colLetter, there is a seperate function to take the 'aloop' number and return the corresponding column letter, confusingly I decided to call this final variable colNumber - it is in fact just the letter of the column that I want.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find function problems - 2 days on this now, please help!

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-24-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Find function problems - 2 days on this now, please help!

    Main Menu -> Select 'Aldershot' in Location -> Select 'produce costings breakdown'

    New book is created with a template sheet, data should be filtered into B and D columns under relevant areas.

    The code behind the MAIN MENU form has a 2/3 of the way down marking the mostly relevant area.
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find function problems - 2 days on this now, please help!

    I can't see why you are using a loop. I would autofilter the sheet based on the selection then use the filtered range.

    All your lookup formulas have Ref# errors

  5. #5
    Registered User
    Join Date
    11-24-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Find function problems - 2 days on this now, please help!

    I'm pretty new to all this, loops are something I understand for the most part. What do you mean by auto filter the sheet based on the selection?

    The ref errors are because i ripped out all the other sheets in the book, its fine though, I just need to know how to get the data into the correct columns.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find function problems - 2 days on this now, please help!

    Will there be only one row for each Location in the caretaking sheet?

  7. #7
    Registered User
    Join Date
    11-24-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Find function problems - 2 days on this now, please help!

    yes, the entry that is there is the same format for all of them, one line per entry. i just can't figure our why the .find function won't work,

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find function problems - 2 days on this now, please help!

    I wouldn't bother with all that code. Try this, look at the example. This is the code that populates the "invoice"

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-24-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Find function problems - 2 days on this now, please help!

    I will try and incorporate that into it, looks good though.

    Any ideas why the find function from the original wouldnt work though?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find function problem

    I didn't have time to work through your code. I'm at work at the moment

+ 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.6.0 RC 1