+ Reply to Thread
Results 1 to 2 of 2

how do i use vba to select all columns on a spreadsheet that contain data.

Hybrid View

pablowilks how do i use vba to select... 11-28-2012, 01:33 PM
tigeravatar Re: how do i use vba to... 11-28-2012, 01:58 PM
  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    San Francisco, USA
    MS-Off Ver
    Excel 2007
    Posts
    60

    how do i use vba to select all columns on a spreadsheet that contain data.

    how do i use vba to select all columns on a spreadsheet that contain data? All data columns are next to each other but i
    do not necessarily know how many columns of data there are.
    Also the first column of data is column A

    many thanks in advance
    Last edited by pablowilks; 11-28-2012 at 01:36 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: how do i use vba to select all columns on a spreadsheet that contain data.

    pablowilks,

    I wouldn't recommend just selecting them. Generally you don't need to select a range in order to perform an operation on it, but seeing as there are no additional details here you go
    ActiveSheet.UsedRange.EntireColumn.Select
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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