Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
peanburn
 
Posts: n/a
Default How do I identify blank cells?

Just learning here. I am trying to identify blank cells and to remove the
rows containing them to another sheet. I have played around with the
IgnoreBlank property but am getting nowhere.

With Range(Cells(2, 3), Cells(1500,3)).Validation
.Delete
.IgnoreBlank = False
End With

Any help would be appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Norman Jones
 
Posts: n/a
Default How do I identify blank cells?

Hi Peanburn,

As an example of selecting all rows on the active sheet which are blank in
column A, copying these rows to another sheet and then deleting the original
blank rows, try something like:

'=============
Public Sub Tester004()
Dim rng1 As range
Dim rng2 As range

Set rng2 = Sheets("Sheet2").range("A1")

On Error Resume Next
Set rng1 = range("A:A"). _
SpecialCells(xlCellTypeBlanks).EntireRow
On Error GoTo 0

If Not rng1 Is Nothing Then
With rng1
.Copy Destination:=rng2
.Delete
End With
End If
End Sub
'<<=============


---
Regards,
Norman



"peanburn" <u18802@uwe wrote in message news:5bff4170941c8@uwe...
Just learning here. I am trying to identify blank cells and to remove the
rows containing them to another sheet. I have played around with the
IgnoreBlank property but am getting nowhere.

With Range(Cells(2, 3), Cells(1500,3)).Validation
.Delete
.IgnoreBlank = False
End With

Any help would be appreciated. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.newusers
Biff
 
Posts: n/a
Default How do I identify blank cells?

Ok, this might sound like a dumb question.......

Why would one copy blank rows to another location?

If they're blank, there's nothing to copy.

Biff

"Norman Jones" wrote in message
...
Hi Peanburn,

As an example of selecting all rows on the active sheet which are blank in
column A, copying these rows to another sheet and then deleting the
original blank rows, try something like:

'=============
Public Sub Tester004()
Dim rng1 As range
Dim rng2 As range

Set rng2 = Sheets("Sheet2").range("A1")

On Error Resume Next
Set rng1 = range("A:A"). _
SpecialCells(xlCellTypeBlanks).EntireRow
On Error GoTo 0

If Not rng1 Is Nothing Then
With rng1
.Copy Destination:=rng2
.Delete
End With
End If
End Sub
'<<=============


---
Regards,
Norman



"peanburn" <u18802@uwe wrote in message news:5bff4170941c8@uwe...
Just learning here. I am trying to identify blank cells and to remove
the
rows containing them to another sheet. I have played around with the
IgnoreBlank property but am getting nowhere.

With Range(Cells(2, 3), Cells(1500,3)).Validation
.Delete
.IgnoreBlank = False
End With

Any help would be appreciated. Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.newusers
Norman Jones
 
Posts: n/a
Default How do I identify blank cells?

Hi Biff,

The rows are defined as blank depending on the column A value - other cells
in such rows are not constrained to be empty.


---
Regards,
Norman



"Biff" wrote in message
...
Ok, this might sound like a dumb question.......

Why would one copy blank rows to another location?

If they're blank, there's nothing to copy.

Biff

"Norman Jones" wrote in message
...
Hi Peanburn,

As an example of selecting all rows on the active sheet which are blank
in column A, copying these rows to another sheet and then deleting the
original blank rows, try something like:

'=============
Public Sub Tester004()
Dim rng1 As range
Dim rng2 As range

Set rng2 = Sheets("Sheet2").range("A1")

On Error Resume Next
Set rng1 = range("A:A"). _
SpecialCells(xlCellTypeBlanks).EntireRow
On Error GoTo 0

If Not rng1 Is Nothing Then
With rng1
.Copy Destination:=rng2
.Delete
End With
End If
End Sub
'<<=============


---
Regards,
Norman



"peanburn" <u18802@uwe wrote in message news:5bff4170941c8@uwe...
Just learning here. I am trying to identify blank cells and to remove
the
rows containing them to another sheet. I have played around with the
IgnoreBlank property but am getting nowhere.

With Range(Cells(2, 3), Cells(1500,3)).Validation
.Delete
.IgnoreBlank = False
End With

Any help would be appreciated. Thanks.







  #5   Report Post  
Posted to microsoft.public.excel.newusers
peanburn via OfficeKB.com
 
Posts: n/a
Default How do I identify blank cells?

Works great! Thanks a lot.
I understand the "On Error" sequence, but am having trouble with

If Not rng1 Is Nothing Then
With rng1
.Copy Destination:=rng2
.Delete
End With
End If


I understand the "with" statements. What is the "If Not rng1 Is Nothing
Then" statement doing?

Norman Jones wrote:
Hi Peanburn,

As an example of selecting all rows on the active sheet which are blank in
column A, copying these rows to another sheet and then deleting the original
blank rows, try something like:


--
Message posted via http://www.officekb.com


  #6   Report Post  
Posted to microsoft.public.excel.newusers
Norman Jones
 
Posts: n/a
Default How do I identify blank cells?

Hi Peanburn,

I understand the "On Error" sequence, but am having trouble with

If Not rng1 Is Nothing Then


I would have liked to say

If rng1 Is Something Then (i.e. if there is something to copy)

but the keyword Something does not exist. Since, however, the keyword
Nothing does exist, I use this with a double negative to obtain a valid
equivalent expression.


---
Regards,
Norman



"peanburn via OfficeKB.com" <u18802@uwe wrote in message
news:5c06fe73933b2@uwe...
Works great! Thanks a lot.
I understand the "On Error" sequence, but am having trouble with

If Not rng1 Is Nothing Then
With rng1
.Copy Destination:=rng2
.Delete
End With
End If


I understand the "with" statements. What is the "If Not rng1 Is Nothing
Then" statement doing?

Norman Jones wrote:
Hi Peanburn,

As an example of selecting all rows on the active sheet which are blank in
column A, copying these rows to another sheet and then deleting the
original
blank rows, try something like:


--
Message posted via http://www.officekb.com



  #7   Report Post  
Posted to microsoft.public.excel.newusers
peanburn via OfficeKB.com
 
Posts: n/a
Default How do I identify blank cells?

Thanks. It makes sense. I really appreciate the help.


Norman Jones wrote:
Hi Peanburn,

I understand the "On Error" sequence, but am having trouble with

If Not rng1 Is Nothing Then


I would have liked to say

If rng1 Is Something Then (i.e. if there is something to copy)

but the keyword Something does not exist. Since, however, the keyword
Nothing does exist, I use this with a double negative to obtain a valid
equivalent expression.

---
Regards,
Norman


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200602/1
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
Replace cells with blank diggers Excel Worksheet Functions 1 November 17th 05 12:23 AM
Replace cells with blank Elkar Excel Worksheet Functions 0 November 16th 05 10:21 PM
pivot tables reports - altering display of (blank) cells cak Excel Worksheet Functions 1 August 22nd 05 12:39 AM
Copy down - special to fill only the blank cells Mike Excel Discussion (Misc queries) 3 April 18th 05 10:08 PM
Non Blank - Blank Cells???? Reggie Excel Discussion (Misc queries) 3 January 12th 05 12:04 AM


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