#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Hiding Rows

Okay. So, at one point in time I used a spreadsheet that had a buttton built
into the spreadsheet that made all rows with no data in column e dissappear.
I am an idiot but i need to do this to my order forms. Then it had another
button that made it reappear.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Hiding Rows

Hi James,
If you want to make data in range become dissapear,
you can do by :
Range("yourrange").clearcontents

but if you want to make it reappear in an action you can see
onundo function from VBA but if you do deletetion you may
lost your data ...
It means onUndo function is only once.

Regards,

Halim

--

Regards,

Halim


"james" wrote:

Okay. So, at one point in time I used a spreadsheet that had a buttton built
into the spreadsheet that made all rows with no data in column e dissappear.
I am an idiot but i need to do this to my order forms. Then it had another
button that made it reappear.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Hiding Rows


Sub do_hide_rows()
Dim row As Integer
Dim rowrange As String
For row = 3 To 8 'your starting and ending rows here
If Cells(row, 5).Value = "" Then
rowrange = CStr(row) & ":" & CStr(row)
Rows(rowrange).Select
Selection.EntireRow.Hidden = True
End If
Next row
End Sub

Sub do_unhide_rows()
Rows("2:9").Select
'1 row before to 1 row after your range in do_hide_rows
Selection.EntireRow.Hidden = False
Range("B16").Select
End Sub


"james" wrote in message
...
Okay. So, at one point in time I used a spreadsheet that had a buttton
built
into the spreadsheet that made all rows with no data in column e
dissappear.
I am an idiot but i need to do this to my order forms. Then it had
another
button that made it reappear.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Hiding Rows

james,

Put a button from the forms toolbar on your sheet and assign this macro to
it:

Sub toggle_filter()
With ActiveSheet
If .FilterMode = True Then
Range("E:E").AutoFilter
Else
.Range("E:E").AutoFilter field:=1, Criteria1:="<"
End If
End With
End Sub

hth,

Doug


"james" wrote in message
...
Okay. So, at one point in time I used a spreadsheet that had a buttton
built
into the spreadsheet that made all rows with no data in column e
dissappear.
I am an idiot but i need to do this to my order forms. Then it had
another
button that made it reappear.



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
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
hiding Rows and buttons/comboxes, over the rows Ctech[_116_] Excel Programming 1 March 21st 06 12:38 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM


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