+ Reply to Thread
Results 1 to 14 of 14

Find text and reorganzize data

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Find text and reorganzize data

    Hello:

    Please refer to attached file.
    I need VB Code or Macro to do the following steps to accomplish my goal:
    1. Find "PLU# / Descriptor" in column A.
    2. Find next "TOTALS" down in column A.
    3. Now you have Start and End Row#'s.
    4. Now replace the text in column A cells between above rows with the digit number only in column A.
    For Example :
    PLU000000000000000032 / FOOD MSC$+ in cell A57 needs to be 32
    PLU000000000000000305 / HAMBURGER in cell A58 needs to be 305

    5. Now copy the associated data in column D and E into column B and C.
    6. Once done need to delete associated data in column D thru I

    Please let me know if any questions.

    Thanks

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Find text and reorganzize data

    The file you supplied is not an Excel workbook. Seems to be a TXT file.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Find text and reorganzize data

    Hello:
    Sorry, please find the attached excel file.
    Thanks and let me know if any questions.
    Riz
    Attached Files Attached Files

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Find text and reorganzize data

    Try this to see if this help.....
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find text and reorganzize data

    Hi Riz,
    Try the attached.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Find text and reorganzize data

    Hello AB33 and sktneer:

    Please refer to attached sheet, i have sheet called "Shouldbe".
    Please refer to that and i believe AB33 can tweak the code little to get me there.
    Please let me know if you have any questions.
    Thanks.
    Riz
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find text and reorganzize data

    Hi Riz,
    I do not see what the issue is. My code was not on the attached and could not see the difference between my code out put and your "Shouldbe".
    You need to show me what my code is missing.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Find text and reorganzize data

    I didn't find any difference in the Sheets "YourCode" and "ShouldBe". On the YourCode Sheet I have used a formula to compare these two sheets whether they differ or not but I didn't find any difference in two sheets. You can refer to the formula in yellow cells in the YourCode sheet.
    Would you please explain that what difference between these two sheets you have noticed? Or I am missing something?
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Find text and reorganzize data

    Hello sktneer:

    Please have a look at the file and see the cells B5:C53.
    Those should not be deleted.
    Please let me know if you have any questions.
    Thanks.

    Riz

  10. #10
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Find text and reorganzize data

    Hi AB33 :

    In your file,
    cell D217:E217 should be in cell B217:C217
    Heading Coun1 and Amount1 should be in column B and C.
    Delete Column D to I.
    Please let me know if you have any questions.
    Thanks.


    Riz

  11. #11
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Find text and reorganzize data

    Please find the attached sheet and click on the Green Button on Test Sheet to see if you get the desired output now.
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Find text and reorganzize data

    Hi sktneer:

    Yes you got it, works great now.
    Thanks a lot.
    Riz

  13. #13
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Find text and reorganzize data

    You're welcome Riz and thanks for the feedback as well.

  14. #14
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find text and reorganzize data

    just requires one line of tweaking. Adjusted code attached.
    Attached Files Attached Files
    Last edited by AB33; 10-30-2014 at 09:50 AM.

+ 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. Find text and numeric value in data
    By Tortus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2013, 10:43 AM
  2. Find and extract specific text data & accompanying numerical data
    By gabrielemucho in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 06-18-2013, 05:58 PM
  3. Find & Import Data from text fil
    By rajeev.raj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2013, 07:23 AM
  4. [SOLVED] Find Next Cell with Data (Text, Number, etc)
    By gerlingc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-28-2013, 05:04 PM
  5. find column with text data in row 1
    By keyser_Soze@usa.com in forum Excel General
    Replies: 0
    Last Post: 10-05-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