+ Reply to Thread
Results 1 to 3 of 3

I need Help With Range Command

Hybrid View

  1. #1
    Dan Thompson
    Guest

    I need Help With Range Command

    Hi All,
    Ok I am using the Range command to select multiple columns like this..

    Range("A:A,B:B,C:C,F:F,AB:AB,AC:AC,BF:BF").Select

    The problem I am having is my actual range of columns includes many more
    columns that the example above.

    Is there a maximum to how man columns you can include to select with the
    range command ?
    because the range command fails when I get to man coluns listed like say 200
    or more.
    Is there another way to accomplish this ? because all I realy want to do is
    have vba do the same thing as if I manual selected up to 200 columns with the
    mouse while holding down the Ctrl button.

  2. #2
    Jim Jackson
    Guest

    RE: I need Help With Range Command

    If you are copying certain columns to paste in another workbook you might
    consider hiding the unwanted columns.

    Columns("D:E").visible = false
    Columns("G:AA").visible=false

    etc.

    then you can have Range("A1:DF3000").select
    Selection.copy

    The only columns copied will be the visible ones.

    Jim


    "Dan Thompson" wrote:

    > Hi All,
    > Ok I am using the Range command to select multiple columns like this..
    >
    > Range("A:A,B:B,C:C,F:F,AB:AB,AC:AC,BF:BF").Select
    >
    > The problem I am having is my actual range of columns includes many more
    > columns that the example above.
    >
    > Is there a maximum to how man columns you can include to select with the
    > range command ?
    > because the range command fails when I get to man coluns listed like say 200
    > or more.
    > Is there another way to accomplish this ? because all I realy want to do is
    > have vba do the same thing as if I manual selected up to 200 columns with the
    > mouse while holding down the Ctrl button.


  3. #3
    Dan Thompson
    Guest

    RE: I need Help With Range Command

    Thanks for the help Jim, however allthough the "visible=false" was a good Idea
    unfortunitly it will not work for what I need to do.

    You see basicly what I am doing is I have a working code that takes chart
    series values and locates them in there corisponding spread sheet. The
    problem is that I want to delete all of irrelavent data columns in the same
    spread sheet, thus only leaving the cloumns that are linked to data series on
    my chart.
    however when I use the Range("A:A,B:B,F:F.... ect ..ect ) command it doesn't
    work once I get too man columns listed I think I can get up to "AF" and than
    the range command seems to run out of gas and goes dumb (Excel VBA just
    ignors that line all together).

    I thought of trying to do this with using the column command but havent
    been able to get that to work etiher.

    Any more thoughts Anyone ?


    "Jim Jackson" wrote:

    > If you are copying certain columns to paste in another workbook you might
    > consider hiding the unwanted columns.
    >
    > Columns("D:E").visible = false
    > Columns("G:AA").visible=false
    >
    > etc.
    >
    > then you can have Range("A1:DF3000").select
    > Selection.copy
    >
    > The only columns copied will be the visible ones.
    >
    > Jim
    >
    >
    > "Dan Thompson" wrote:
    >
    > > Hi All,
    > > Ok I am using the Range command to select multiple columns like this..
    > >
    > > Range("A:A,B:B,C:C,F:F,AB:AB,AC:AC,BF:BF").Select
    > >
    > > The problem I am having is my actual range of columns includes many more
    > > columns that the example above.
    > >
    > > Is there a maximum to how man columns you can include to select with the
    > > range command ?
    > > because the range command fails when I get to man coluns listed like say 200
    > > or more.
    > > Is there another way to accomplish this ? because all I realy want to do is
    > > have vba do the same thing as if I manual selected up to 200 columns with the
    > > mouse while holding down the Ctrl button.


+ 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