Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Hide an entire row - Not working

I am trying to use this code to hide a row. Am I using a property that
doesn't work? I do not get any error messages... I just do not get the
desired results.

If MyNewArchHide = True Then
For i = 1 To rng.Count
If cName(i) = "Transaction Date" Then
Set rng2 = .Range(.Cells(1, i), .Cells(2 ^ 16,
i).End(xlUp))
For j = rng2.Count To 2 Step -1
If .Cells(j, i).Value LowYear _
And .Cells(j, StatusColumn).Value = "Archive" Then
Rows(j).Select
HideSelection = True
End If
Next j
End If
Next i
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Hide an entire row - Not working

Try:
Selection.EntireColumn.Hidden = True

"Mark" wrote:

I am trying to use this code to hide a row. Am I using a property that
doesn't work? I do not get any error messages... I just do not get the
desired results.

If MyNewArchHide = True Then
For i = 1 To rng.Count
If cName(i) = "Transaction Date" Then
Set rng2 = .Range(.Cells(1, i), .Cells(2 ^ 16,
i).End(xlUp))
For j = rng2.Count To 2 Step -1
If .Cells(j, i).Value LowYear _
And .Cells(j, StatusColumn).Value = "Archive" Then
Rows(j).Select
HideSelection = True
End If
Next j
End If
Next i
End If

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Hide an entire row - Not working

selection.entirerow.hidden = true
??

or just
rows(j).hidden = true

(and get rid of the .select line)

JNW wrote:

Try:
Selection.EntireColumn.Hidden = True

"Mark" wrote:

I am trying to use this code to hide a row. Am I using a property that
doesn't work? I do not get any error messages... I just do not get the
desired results.

If MyNewArchHide = True Then
For i = 1 To rng.Count
If cName(i) = "Transaction Date" Then
Set rng2 = .Range(.Cells(1, i), .Cells(2 ^ 16,
i).End(xlUp))
For j = rng2.Count To 2 Step -1
If .Cells(j, i).Value LowYear _
And .Cells(j, StatusColumn).Value = "Archive" Then
Rows(j).Select
HideSelection = True
End If
Next j
End If
Next i
End If


--

Dave Peterson
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
MS Excel: hide a selection of data (not an entire row or column)? Panda Q Excel Discussion (Misc queries) 4 August 13th 08 10:11 PM
Hide a CELL (not entire row or column) when printing shapiro Excel Discussion (Misc queries) 4 July 2nd 07 01:50 PM
Hide an entire tab. ChuckF Excel Worksheet Functions 3 March 28th 06 05:52 PM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM
Hide Unapplicable Ranges of Entire Rows monir Excel Programming 2 March 31st 05 05:37 PM


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