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 / November 2007

Tip: Looking for answers? Try searching our database.

Reference to Columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angeles - 22 Nov 2007 17:38 GMT
Hi , I am using the next line :

ActiveWorkbook.Worksheets("A").Columns((ConvertToLetter(inicol)) & ":" &
msConvertToLetter(endcol)).Select

Does exist some way for using only the Column Number ?  I would prefer don´t
use the function ConvertToLetter.

Thank you in advance.
Rick Rothstein (MVP - VB) - 22 Nov 2007 18:25 GMT
> ActiveWorkbook.Worksheets("A").Columns((ConvertToLetter(inicol)) & ":" &
> msConvertToLetter(endcol)).Select
>
> Does exist some way for using only the Column Number ?  I would prefer
> don´t
> use the function ConvertToLetter.

Well, you could always do what ConvertToLetter does directly in your code...

ActiveWorkbook.Worksheets("A").Columns(Chr(IniCol + 64) & ":" & Chr(EndCol +
64)).Select

Rick
Rick Rothstein (MVP - VB) - 22 Nov 2007 18:31 GMT
>> ActiveWorkbook.Worksheets("A").Columns((ConvertToLetter(inicol)) & ":" &
>> msConvertToLetter(endcol)).Select
[quoted text clipped - 8 lines]
> ActiveWorkbook.Worksheets("A").Columns(Chr(IniCol + 64) & ":" & Chr(EndCol
> + 64)).Select

I can't help feeling there is a more direct method that I am simply
overlooking; but, anyway, here is another way to do it...

ActiveWorkbook.Worksheets("A").Columns(IniCol).Resize(Rows.Count, EndCol -
IniCol).Select

Rick
Rick Rothstein (MVP - VB) - 22 Nov 2007 18:35 GMT
> ActiveWorkbook.Worksheets("A").Columns(IniCol).Resize(Rows.Count, EndCol -
> IniCol).Select

I forgot the +1...

ActiveWorkbook.Worksheets("Sheet1").Columns(IniCol).Resize(Rows.Count,
EndCol - IniCol + 1).Select

Rick
Mike Fogleman - 22 Nov 2007 18:37 GMT
See my responses Rick.

Mike Fogleman
>>> ActiveWorkbook.Worksheets("A").Columns((ConvertToLetter(inicol)) & ":" &
>>> msConvertToLetter(endcol)).Select
[quoted text clipped - 16 lines]
>
> Rick
Rick Rothstein (MVP - VB) - 22 Nov 2007 18:51 GMT
Thanks... see, I knew I was missing something obvious.

Rick

> See my responses Rick.
>
[quoted text clipped - 20 lines]
>>
>> Rick
JLGWhiz - 22 Nov 2007 18:29 GMT
ActiveWorkbook.Worksheets("A").Columns((ConvertToLetter(inicol)) & ":" &
msConvertToLetter(endcol)).Select

You could do it this way:

ActiveWorkbook.Worksheets("A").Range(Cells(1, inicol), Cells(65536,
endcol).Select

> Hi , I am using the next line :
>
[quoted text clipped - 5 lines]
>
> Thank you in advance.
Mike Fogleman - 22 Nov 2007 18:32 GMT
Range(Columns(2), Columns(10)).Select

Mike F
> Hi , I am using the next line :
>
[quoted text clipped - 6 lines]
>
> Thank you in advance.
Mike Fogleman - 22 Nov 2007 18:35 GMT
Using your variables Dimmed As Long:

Range(Columns(inicol), Columns(endcol)).Select

Mike F
> Range(Columns(2), Columns(10)).Select
>
[quoted text clipped - 9 lines]
>>
>> Thank you in advance.
 
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.