Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default select populated cells

i hate to ask this, because i'm sure it's come up a
million times before, but i've searched high and low and
couldn't find anything:

how do you select all of the populated cells of a
worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default select populated cells

Dim rng1 as Range, rng2 as Range, rng3 as Range
On Error resume next
set rng1 = Activesheet.Cells.SpecialCells(xlconstants)
set rng2 = Activesheet.Cells.SpecialCells(xlFormulas)
On Error goto 0
if not rng1 is nothing and not rng2 is nothing then
set rng3 = Union(rng1,rng2)
elseif not rng1 is nothing then
set rng3 = rng1
elseif not rng2 is nothing then
set rng3 = rng2
End if
if not rng3 is nothing then
rng3.Select
End if

--
Regards,
Tom Ogilvy

"Kevin" wrote in message
...
i hate to ask this, because i'm sure it's come up a
million times before, but i've searched high and low and
couldn't find anything:

how do you select all of the populated cells of a
worksheet?



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
Cells to be populated from an workbook to another. Fred's Excel Discussion (Misc queries) 1 March 12th 09 03:35 PM
how do populate empty cells with the contents of populated cells . Jim99 Excel Discussion (Misc queries) 6 April 21st 05 05:44 PM
Populated cells Al Excel Programming 2 May 24th 04 03:39 PM
how to find out when a ListBox is populated or select it Valeria[_2_] Excel Programming 2 January 26th 04 12:31 PM


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