Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select Half a Worksheet

Good Morning to you all.

Little question here today. I got a worksheet that the lenght can change for
month to month. All i need is to select only half the column in a macro. So
far i found how to make my macro select all of them, and it's no good.

Any suggestion?


Batty

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select Half a Worksheet

Hi Batty,

could you elboarate on what you mean by 'half the column'


---
Regards,
Norman


"Battykoda" <u33810@uwe wrote in message news:717a119045498@uwe...
Good Morning to you all.

Little question here today. I got a worksheet that the lenght can change
for
month to month. All i need is to select only half the column in a macro.
So
far i found how to make my macro select all of them, and it's no good.

Any suggestion?


Batty



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select Half a Worksheet

There we go.

Let's say that right now, my worsheet that has 130 column. I need to be able
to get only 75 column of that. The point is, my report will expand every
month, so i want my macro to select half instead of just going to column 75.

After that, i have a serie of treatment that are going to be applied to that
half... but... right now... im stuck with the selection.

Clearer that way? (It is so clear in my mind... if only excel could get that!!
!)

Batty

Norman Jones wrote:
Hi Batty,

could you elboarate on what you mean by 'half the column'

---
Regards,
Norman

Good Morning to you all.

[quoted text clipped - 7 lines]

Batty


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Select Half a Worksheet

Hi Batty,

I'm a bit confused by 'half a column' but if you mean you want to select
your used range only and leave blank cell then something like this may help:-

Sub ranges()
Dim myrange As Range
rowno = ActiveSheet.Range("A65536").End(xlUp).Row
Set myrange = Range("A1:K" & rowno) '< Alter A1 and K to suit
myrange.Select
End Sub

Mike

"Battykoda" wrote:

Good Morning to you all.

Little question here today. I got a worksheet that the lenght can change for
month to month. All i need is to select only half the column in a macro. So
far i found how to make my macro select all of them, and it's no good.

Any suggestion?


Batty


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Select Half a Worksheet

like this?

Sub Test()
Dim iTotalColumns As Integer
iTotalColumns = ActiveSheet.UsedRange.Columns.Count
Range(Columns(1), Columns(iTotalColumns \ 2)).Select
End Sub



--
Hope that helps.

Vergel Adriano


"Battykoda" wrote:

Good Morning to you all.

Little question here today. I got a worksheet that the lenght can change for
month to month. All i need is to select only half the column in a macro. So
far i found how to make my macro select all of them, and it's no good.

Any suggestion?


Batty




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select Half a Worksheet

Hi Batty,

Try something like:

'=============
Public Sub Tester()
Dim Rng As Range
Dim i As Long

Set Rng = Range("A1").CurrentRegion
i = Rng.Columns.Count

Rng.Resize(, Int(i / 2)).Select

End Sub
'<<==========


---
Regards,
Norman




"Battykoda" <u33810@uwe wrote in message news:717a47408858c@uwe...
There we go.

Let's say that right now, my worsheet that has 130 column. I need to be
able
to get only 75 column of that. The point is, my report will expand every
month, so i want my macro to select half instead of just going to column
75.

After that, i have a serie of treatment that are going to be applied to
that
half... but... right now... im stuck with the selection.

Clearer that way? (It is so clear in my mind... if only excel could get
that!!
!)

Batty

Norman Jones wrote:
Hi Batty,

could you elboarate on what you mean by 'half the column'

---
Regards,
Norman

Good Morning to you all.

[quoted text clipped - 7 lines]

Batty




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select Half a Worksheet

Thanks Vergel, thats exactly what i was looking for!!!!

Batty!!!


Vergel Adriano wrote:
like this?

Sub Test()
Dim iTotalColumns As Integer
iTotalColumns = ActiveSheet.UsedRange.Columns.Count
Range(Columns(1), Columns(iTotalColumns \ 2)).Select
End Sub

Good Morning to you all.

[quoted text clipped - 5 lines]

Batty


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
Conditional formatting only working for half of worksheet mmurphy Excel Discussion (Misc queries) 1 December 15th 09 05:53 PM
print half of rows on left and other half on right Steve B. Excel Discussion (Misc queries) 2 November 16th 07 11:20 AM
Can I have the bottom half Worksheet with less columns than Top Toby Excel Discussion (Misc queries) 1 May 19th 07 12:57 PM
Workbook VBA not recognising half the new worksheet!! Simon Lloyd[_530_] Excel Programming 2 August 14th 04 07:45 PM
Full Screen With Status Cut Worksheet Tabs in Half Dean[_6_] Excel Programming 2 June 17th 04 12:06 PM


All times are GMT +1. The time now is 12:58 AM.

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

About Us

"It's about Microsoft Excel"