Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using a the active cell in a range command.... dr chuck Excel Programming 4 July 7th 06 03:03 PM
Using variables in the Range command Chi Man Wong Excel Programming 2 March 2nd 05 03:35 PM
Need help using a variable in Range command cbeebe[_7_] Excel Programming 1 November 5th 04 05:29 PM
Setting Range Command Frank Stone Excel Programming 1 July 21st 04 11:02 PM
Variable usage in Range Command DavidC[_2_] Excel Programming 2 May 27th 04 03:51 AM


All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"