+ Reply to Thread
Results 1 to 13 of 13

VBA Select range based on criteria in column

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    VBA Select range based on criteria in column

    Good day to all,

    thanks to help me with developing a vba code taht Will do the followting:

    EXAMPLE.xlsx

    it sohuld select range fm column A to E for rach customer in column C - please check attached example table.
    Refering to attached table,for customer sohuld select fm range A2:E5, for customer 2 fm A6:E7...ecc..it should also incude the header row.

    thanks in advance.

    brgds,
    forfiett

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Select range based on criteria in column

    What do you plan on doing after the data is selected?

  3. #3
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    Dear,

    Print out selection.

    Brgds,
    forfiett

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Select range based on criteria in column

    For each customer? Or when you select a customer row?

  5. #5
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    I want to print out a range for each cutomer.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Select range based on criteria in column

    Maybe:

    Please Login or Register  to view this content.
    Note: In Column 3 on your test file Customer is spelled a variety of ways.

  7. #7
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    Dear,

    thanks for provided but is not wokitng for me (is not working like it sould):

    it must pritn out as attached examples for each customer in column C

    2.pdf1.pdf3.pdf

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Select range based on criteria in column

    OK try this (print code added).

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 01-28-2016 at 02:38 PM.

  9. #9
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    On a test file it is working perfectly but I have some problem seting up it at my main file.
    My original file is fm range A to AE (print range) and customers are in column "J" starting in cell 4, so from J4 and not C2 as on test file.
    Can you please help me modifying the code for my original file.

    thanks!!

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Select range based on criteria in column

    Maybe:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    it is working perfectly,

    my next question is, it is possible to include also the last (TOTAL) row?

    thanks

  12. #12
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    any good news?

  13. #13
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: VBA Select range based on criteria in column

    Good day,

    is possible to amend code to print in PDF file with file name from cell i/o print out on printer.

    Thanks.

+ 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. [SOLVED] select column range based on a matched value
    By onroute in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-17-2015, 06:28 PM
  2. Select range based off column name
    By randomonium in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2015, 07:35 AM
  3. [SOLVED] Select to the end of a row based on used column range
    By BrownBoy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-20-2014, 02:14 PM
  4. Replies: 4
    Last Post: 07-19-2013, 04:35 AM
  5. Select Range based on data in different column
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 09:10 AM
  6. Need code to select a range of cells based on criteria in column H
    By davekippen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2011, 01:40 PM
  7. [SOLVED] How to select a range based on values in 1 column
    By ForestRamsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2005, 12: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