Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default MACRO: Catching only filled cell data

I want to have a macro to select the cells with only filled data . I
have tried with the dollar sign to select the entire sheet but it does
not work. just give in options

Thankue

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default MACRO: Catching only filled cell data

Sub nonempty()
Dim rr As Range, r2 As Range, r3 As Range
Dim r4 As Range
Set r2 = ActiveSheet.UsedRange
Set r3 = ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlank s)
For Each rr In r2
If Intersect(rr, r3) Is Nothing Then
If r4 Is Nothing Then
Set r4 = rr
Else
Set r4 = Union(r4, rr)
End If
End If
Next
r4.Select
End Sub

But it wil not select cells that have only comments in them.
--
Gary's Student


"sumit" wrote:

I want to have a macro to select the cells with only filled data . I
have tried with the dollar sign to select the entire sheet but it does
not work. just give in options

Thankue


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
Manual control of link updating for downloaded quotes? dk_ Excel Discussion (Misc queries) 9 November 15th 06 01:04 PM
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM


All times are GMT +1. The time now is 09:22 AM.

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"