LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default #REF! help please

Hi Folks,

Using this code, I'm copying a range of cells from one sheet to
another (Thanks to Simon for the code)
~~~~~~~~~~~
Public Sw As Long
Sub HideRows()
Dim Rng As Range, MyCell As Range
Set Rng = Sheets("Sheet1").Range("B29:B" & Range("B" &
Rows.Count).End(xlUp).Row)
If Sw = 1 Then
Rng.Rows.Hidden = False
Sw = 0
Exit Sub
End If
For Each MyCell In Rng
If MyCell.Value = 0 Then
MyCell.Rows.Hidden = True
Sw = 1
End If
Next MyCell
Rng.SpecialCells(xlCellTypeVisible).EntireRow.Copy
Destination:=Sheets("Sheet2").Range("A3")
End Sub
~~~~~~~~~~~~~

The problem is that the new sheet contains mostly #REF! errors. I
have tried xlCellTypeAllFormatConditions instead but I get a VB error
that says "Run-time error '1004': Application-defined or object-
defined error"

Any suggestions? If you cannot tell, I am a VBA dolt. :)

Many thanks!
Craig
 
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



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