#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Halfway to End

How do I select the bottom half of a column's cells in a macro?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Halfway to End

with/without blanks and why

--
Don Guillett
SalesAid Software

"Rokuro kubi" wrote in message
ups.com...
How do I select the bottom half of a column's cells in a macro?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 301
Default Halfway to End

Sub Untested()
Rw = Range("A65536").End(xlUp).Row 'change "A" to the column you're
interested in
Rw = Rw \ 2
Range(Range("A1").Offset(Rw), Range("A65536").End(xlUp)).Select
End Sub


"Rokuro kubi" wrote in message
ups.com...
How do I select the bottom half of a column's cells in a macro?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 136
Default Halfway to End

Hello,

For example:
Dim i As Long, j As Long
i = Range("A1").Column
j = Cells(65536, i).End(xlUp).Row
Range(Cells(j / 2 + 1, i), Cells(j, i)).Select

HTH,
Bernd

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Halfway to End

Sub selecthalfcolumn()'ignores blanks
lr = Cells(Rows.Count, "a").End(xlUp).Row / 2
Range(Cells(1, 1), Cells(lr, 1)).Select
End Sub

--
Don Guillett
SalesAid Software

"Rokuro kubi" wrote in message
ups.com...
How do I select the bottom half of a column's cells in a macro?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Halfway to End

Because a column always contains 65536 cells, the bottom half is 32769 thru
65536. For example:

Sub gsnu()
Range("A32769:A65536").Select
End Sub
--
Gary's Student


"Rokuro kubi" wrote:

How do I select the bottom half of a column's cells in a macro?


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Halfway to End


Don Guillett wrote:

Sub selecthalfcolumn()'ignores blanks
lr = Cells(Rows.Count, "a").End(xlUp).Row / 2
Range(Cells(1, 1), Cells(lr, 1)).Select
End Sub

--
Don Guillett
SalesAid Software

"Rokuro kubi" wrote in message
ups.com...
How do I select the bottom half of a column's cells in a macro?


That's great Don, cheers

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
if month is less than halfway over subtract 1 coal_miner Excel Worksheet Functions 3 May 4th 05 03:57 PM


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