+ Reply to Thread
Results 1 to 4 of 4

Select all items in column, even if only one.

  1. #1
    Registered User
    Join Date
    02-11-2022
    Location
    Spokane, Washington USA
    MS-Off Ver
    365
    Posts
    3

    Select all items in column, even if only one.

    I bring data into a spreadsheet, then filter to get the information I need. The information can be one row or thousands of rows of data. Is there a way to select one, if only one item is found, or all items, if more than one are in column I. The formula I use works well (see below) except with only one item under the heading it selects the whole column. I don't want the whole column.

    Range("I2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,656

    Re: Select all items in column, even if only one.

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Select all items in column, even if only one.

    Hi,

    It's rarely necessary to use .Select .Activate and similar, it just slows down the code. Just address the relevant range directly.
    In your case

    Range("I2", Range("I" & Rows.Count).End(xlUp)).Copy
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    02-11-2022
    Location
    Spokane, Washington USA
    MS-Off Ver
    365
    Posts
    3

    Re: Select all items in column, even if only one.

    Thank you Richard. That worked perfectly.

+ 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. Replies: 0
    Last Post: 05-14-2021, 06:35 AM
  2. [SOLVED] Select Multiple Items in More than One Column
    By mhall1957 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2020, 09:16 PM
  3. VBA select all items in active folder and print all items in folder
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2017, 06:49 AM
  4. Newbie: Auto Select/un-Select an Range of Slicer Items
    By luckyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 09:52 AM
  5. Select Multiple Items in a List and then Print Those Items
    By dcdoc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-26-2013, 01:16 PM
  6. [SOLVED] List unmatched items in 3rd column & sum matched items in 4th column
    By sharonvining in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-12-2012, 03:24 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