Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
Hiding Specific Rows Based on Values in Other Rows | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
hiding Rows and buttons/comboxes, over the rows | Excel Programming | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) |