+ Reply to Thread
Results 1 to 6 of 6

VB Novice...Find and Move Cells...

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    IL
    Posts
    3

    VB Novice...Find and Move Cells...

    Hi Forum.

    Have a "task" that's been handed to me to conduct some analysis for market stats. The problem is the data I have to work with has "headers" actually contained within each row versus being formatted nicely in columns.

    Example:
    Each row of my worksheet contains data for an individual client. Within each client (row) there are employee counts per company assigned to that client. The cell structure in each row is:
    Client Name Address, etc./the literal "EMPLOYEES"/Company#/data/data/"EMPLOYEES"/Company#/data/data/EMPLOYEES/ and continues on in that pattern in each row reporting each company in the same row.

    Problem: The cells are not aligned. A client could have one company or 100 companies....all going across the same row.

    I understand the logic just don't know how to write it. I need the macro to ultimately "find" the text "EMPLOYEES" and copy the next 3 cells to the right (company#/data/data) to a new worksheet so I can have all of the companies' data in one sheet and in two columns so I can analyze the numbers (highs, lows, averages, etc.). I don't necessarily need the company# copied, but figured it would be easier just to grab all 3 cells to the right of "EMPLOYEES" whereever the literal "EMPLOYEES" is found.

    Hope this makes sense.

    I am using Excel2007


    thanks for any help!
    JohnH

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Please may you enclose a little example of your workbook so we can help you better.

    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    08-27-2008
    Location
    IL
    Posts
    3

    Sample

    I'm attaching a small sample of the over 6000 records (rows). Columns A through G are specific to the client's name and address so I've replaced those with 'xx'. The relevant data starts with column H.

    Again the logic I'm looking to use would be to programatically find the literal "EMPLOYEES" and copy and paste the next 3 cells to the right of "EMPLOYEES" into a new worksheet - each copy/paste of data creating a new row in the new worksheet.

    Hope that helps! Thanks Antonio.

    John
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Like so perhaps?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-27-2008
    Location
    IL
    Posts
    3

    Worked great!

    StephenR. Looked too simple, but worked like a charm. Thanks.

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    If you need also companies code you can add blue row:
    Please Login or Register  to view this content.
    Regards,
    Antonio

+ 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 Values, Delete and Move Left
    By rkeane7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2008, 09:34 AM
  2. find name; search column; if date found-return 3 data pts; move to next row
    By cdl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2008, 10:43 AM
  3. Using smallscroll to find a value and move to it
    By mrdata in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2007, 08:15 PM
  4. Find a Range and move to different columns
    By Eularios in forum Excel General
    Replies: 6
    Last Post: 03-24-2007, 07:59 PM

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