Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default select column

hi,

turns out there were some merged cells. ok here is another problem... so if
the column is ALREADY hidden, how can i add some error/process handling to
the following:

Columns("D").Select
Selection.EntireColumn.Hidden = True

thanks in advance,
geebee



"JLGWhiz" wrote:

Aside from possibly having merged cells somewhere in the column, I don't know
what would cause that. However, as a sidepoint, if you are selecting the
entire column you don't need the attenuation colon. Just do

Columns("D").Select

You only need the attenuation colon if you are selecting more than one column.

"geebee" wrote:

hi,

I have the following:
Columns("D:D").Select


for some reason columns C AND D are being selected?

why?

thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select column

First off, the functionality of the two statements you listed can be
accomplished with this single statement...

Columns("D").Hidden = True

Executing this statement when the column is already hidden will not generate
an error, so I am guessing you have other code following the code you showed
us which you do not wish to have executed if the column is already hidden.
Something like this should do what (I think) you want...

If Not Columns("D").Hidden Then
Columns("D").Hidden = True: Print "Hello"
'
' <<Your other code
'
End If

Rick



"geebee" (noSPAMs) wrote in message
...
hi,

turns out there were some merged cells. ok here is another problem... so
if
the column is ALREADY hidden, how can i add some error/process handling to
the following:

Columns("D").Select
Selection.EntireColumn.Hidden = True

thanks in advance,
geebee



"JLGWhiz" wrote:

Aside from possibly having merged cells somewhere in the column, I don't
know
what would cause that. However, as a sidepoint, if you are selecting the
entire column you don't need the attenuation colon. Just do

Columns("D").Select

You only need the attenuation colon if you are selecting more than one
column.

"geebee" wrote:

hi,

I have the following:
Columns("D:D").Select


for some reason columns C AND D are being selected?

why?

thanks in advance,
geebee


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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
select a column, then add rows of each column darcy Excel Discussion (Misc queries) 3 August 27th 09 12:13 AM
how to select a single column when this column cross a merged cell cnEagle Excel Programming 1 November 13th 07 04:49 AM
Shortcut to select column with data in previous column TJAC Excel Discussion (Misc queries) 1 July 10th 07 06:12 PM
select detail in column B if column A = date Dan B Excel Worksheet Functions 0 September 18th 06 04:46 PM


All times are GMT +1. The time now is 07:04 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"