#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default select cells

Hi, how can i select with a macro all cells with data below activecell?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default select cells

This macro should do what you want...

Sub SelectNonEmptyCellsBelowActiveCell()
Dim LastCell As Range
On Error Resume Next
Set LastCell = Cells(Rows.Count, ActiveCell.Column).End(xlUp)
Range(ActiveCell.Offset(1), LastCell).SpecialCells( _
xlCellTypeConstants).Select
End Sub

--
Rick (MVP - Excel)


"puiuluipui" wrote in message
...
Hi, how can i select with a macro all cells with data below activecell?
Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default select cells

In any column or only the activecell's column??
--
Gary''s Student - gsnu200908


"puiuluipui" wrote:

Hi, how can i select with a macro all cells with data below activecell?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default select cells

To select cells below the active cell with data in them:

Sub WithData()
Set r = Range(ActiveCell.Offset(1, 0), Cells(Rows.Count, ActiveCell.Column))
Set r = Intersect(r, ActiveSheet.UsedRange)
Set rSelect = Nothing
For Each rr In r
If IsEmpty(rr) Then
Else
If rSelect Is Nothing Then
Set rSelect = rr
Else
Set rSelect = Union(rSelect, rr)
End If
End If
Next
rSelect.Select
End Sub

--
Gary''s Student - gsnu200908


"puiuluipui" wrote:

Hi, how can i select with a macro all cells with data below activecell?
Thanks!

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
Up down arrow keys do not select cells if select locked cells unch roandrob Excel Discussion (Misc queries) 3 May 18th 09 12:48 AM
Macro to select cells without a certain value and select a menu it Guy[_2_] Excel Worksheet Functions 9 January 2nd 09 05:21 PM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM
Why aren't my cells highlighted when I select multiple cells? TChristian Setting up and Configuration of Excel 0 January 26th 05 10:23 PM


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