+ Reply to Thread
Results 1 to 7 of 7

Range of several idividual columns

  1. #1
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Range of several idividual columns

    I have this following code that is causing problems:

    Please Login or Register  to view this content.
    I wish the range to include just certain columns.
    unfortunatilgy the range selections are not working.

    need help

  2. #2
    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: Range of several idividual columns

    Hi,

    Try

    Please Login or Register  to view this content.
    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.

  3. #3
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Range of several idividual columns

    Tried that it selects all columns from A1 to L1

  4. #4
    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: Range of several idividual columns

    Hi,

    If you're looking to select cells, as your original post suggested then as I said

    Please Login or Register  to view this content.
    will do that, or if you want to select whole columns then
    Please Login or Register  to view this content.
    If you're looking to create a new file then I'd be inclined to use

    Please Login or Register  to view this content.
    to create a new workbook from Sheet1 and then delete the columns you don't want.

  5. #5
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Range of several idividual columns

    Im trying to select the columns to export to a pdf document for printing

    When I place the select after the range I get a error


    Please Login or Register  to view this content.
    Last edited by wayneao; 11-10-2014 at 12:40 PM.

  6. #6
    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: Range of several idividual columns

    I didn't say put the .Select in your sheet export line of code. I don't believe you can do it that way.

    That's why I said you should use the Sheet1.Copy line, then delete the stuff you don't want then your

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF,...... code

    finishing the code with
    Please Login or Register  to view this content.
    to close the single sheet workbook you created from your main workbook.

  7. #7
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Range of several idividual columns

    Used

    Sheet1.copy ("A1, D1, F1, J1")

    Error copy of object failed

+ 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: 2
    Last Post: 12-24-2013, 06:53 PM
  2. [SOLVED] Macro to hide entire columns within range if cells within range are blank
    By graphicgoose in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2013, 08:26 PM
  3. [SOLVED] Transpose 2 Columns into Multiple Columns per Range of Cells
    By ub3rm0nk3y in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 02:30 PM
  4. Replies: 0
    Last Post: 09-15-2012, 02:56 AM
  5. [SOLVED] Hide columns based on cell value - Unable to set hidden range property of Range Class
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2012, 11:13 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