Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Trying to Hide Rows with :30

I have a range of cells, with time in half-hour increments. I would like to
hide all rows with a :30 in Range A. I put together this macro, but it
doesnt actually do anything. What am I missing?

Sub HideRows()
Dim cell As Range
Application.ScreenUpdating = False
If tgButton = True Then
For Each cell In Range("A5:A20000")
If cell.Value Like ":30" Then
cell.EntireRow.Hidden = True
End If
Next cell
Else
Range("A5:A20000").Rows.EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub

Here is some sample data:
12:30:00 AM
1:00:00 AM
1:30:00 AM
2:00:00 AM

Thanks,
Ryan---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Trying to Hide Rows with :30

Hi RyGuy

Use cell.Text instead of cell.Value


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RyGuy" wrote in message ...
I have a range of cells, with time in half-hour increments. I would like to
hide all rows with a :30 in Range A. I put together this macro, but it
doesnt actually do anything. What am I missing?

Sub HideRows()
Dim cell As Range
Application.ScreenUpdating = False
If tgButton = True Then
For Each cell In Range("A5:A20000")
If cell.Value Like ":30" Then
cell.EntireRow.Hidden = True
End If
Next cell
Else
Range("A5:A20000").Rows.EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub

Here is some sample data:
12:30:00 AM
1:00:00 AM
1:30:00 AM
2:00:00 AM

Thanks,
Ryan---


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Trying to Hide Rows with :30

Thanks Ron, but it's still not working.
Any other ideas?
Ryan--

"Ron de Bruin" wrote:

Hi RyGuy

Use cell.Text instead of cell.Value


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RyGuy" wrote in message ...
I have a range of cells, with time in half-hour increments. I would like to
hide all rows with a :30 in Range A. I put together this macro, but it
doesnt actually do anything. What am I missing?

Sub HideRows()
Dim cell As Range
Application.ScreenUpdating = False
If tgButton = True Then
For Each cell In Range("A5:A20000")
If cell.Value Like ":30" Then
cell.EntireRow.Hidden = True
End If
Next cell
Else
Range("A5:A20000").Rows.EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub

Here is some sample data:
12:30:00 AM
1:00:00 AM
1:30:00 AM
2:00:00 AM

Thanks,
Ryan---


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Trying to Hide Rows with :30

This little thing did the trick:

Sub HideIf30()
For Each cell In Range("A1:A20000")
If cell.Text Like "*:30*" Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub

Hopefully this helps others.
Thanks everyone!
Ryan--


"RyGuy" wrote:

Thanks Ron, but it's still not working.
Any other ideas?
Ryan--

"Ron de Bruin" wrote:

Hi RyGuy

Use cell.Text instead of cell.Value


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RyGuy" wrote in message ...
I have a range of cells, with time in half-hour increments. I would like to
hide all rows with a :30 in Range A. I put together this macro, but it
doesnt actually do anything. What am I missing?

Sub HideRows()
Dim cell As Range
Application.ScreenUpdating = False
If tgButton = True Then
For Each cell In Range("A5:A20000")
If cell.Value Like ":30" Then
cell.EntireRow.Hidden = True
End If
Next cell
Else
Range("A5:A20000").Rows.EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub

Here is some sample data:
12:30:00 AM
1:00:00 AM
1:30:00 AM
2:00:00 AM

Thanks,
Ryan---


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Trying to Hide Rows with :30

Yes, you need that also

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RyGuy" wrote in message ...
This little thing did the trick:

Sub HideIf30()
For Each cell In Range("A1:A20000")
If cell.Text Like "*:30*" Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub

Hopefully this helps others.
Thanks everyone!
Ryan--


"RyGuy" wrote:

Thanks Ron, but it's still not working.
Any other ideas?
Ryan--

"Ron de Bruin" wrote:

Hi RyGuy

Use cell.Text instead of cell.Value


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RyGuy" wrote in message ...
I have a range of cells, with time in half-hour increments. I would like to
hide all rows with a :30 in Range A. I put together this macro, but it
doesnt actually do anything. What am I missing?

Sub HideRows()
Dim cell As Range
Application.ScreenUpdating = False
If tgButton = True Then
For Each cell In Range("A5:A20000")
If cell.Value Like ":30" Then
cell.EntireRow.Hidden = True
End If
Next cell
Else
Range("A5:A20000").Rows.EntireRow.Hidden = False
End If
Application.ScreenUpdating = False
End Sub

Here is some sample data:
12:30:00 AM
1:00:00 AM
1:30:00 AM
2:00:00 AM

Thanks,
Ryan---

.


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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Excel Programming 2 August 29th 08 03:53 PM
hide multiple rows based on condition within rows Skymann Excel Programming 6 October 21st 07 04:01 PM
Specify which rows to NOT hide, and have excel hide the rest Mo2 Excel Programming 0 April 25th 07 03:44 AM


All times are GMT +1. The time now is 11:36 PM.

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"