Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

select column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 15 May 2008 15:00 GMT
hi,

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

for some reason columns C AND D are being selected?

why?  

thanks in advance,
geebee
JLGWhiz - 15 May 2008 15:10 GMT
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.

> hi,
>
[quoted text clipped - 7 lines]
> thanks in advance,
> geebee
geebee - 15 May 2008 15:32 GMT
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

> 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
[quoted text clipped - 15 lines]
> > thanks in advance,
> > geebee
Rick Rothstein (MVP - VB) - 15 May 2008 16:02 GMT
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

> hi,
>
[quoted text clipped - 30 lines]
>> > thanks in advance,
>> > geebee
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.