Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
by this script, I filter some data except the data filled in inputbox. Now I would delete each data hidden except the data shown Can u help me please? thanks a lot. Private Sub button1_Click() Dim rng As Range Dim c As Range Dim nr As Long Dim cond(10) As Variant Dim i As Integer Dim S As Intege S = InputBox("Qual è il numero degli addetti per l'internaz DIURNO?") Sheets("INT_GG").Select For i = 1 To S cond(i) = InputBox("Inserire condizione " & i, "tuoTitolo") Next Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = True For Each c In rng Select Case c.Value Case Is = cond(1), cond(2), cond(3), cond(4), cond(5), cond(6), cond(7), cond(8), cond(9), cond(10) Foglio19.Rows(c.Row).Hidden = False Case Else End Select Next End Sub Public Sub mScopri1() Dim rng As Range Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = False -- BBB |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Keep the rows that match the criteria and delete the ones that don't match?
Maybe... Option Explicit Private Sub button1_Click() Dim rng As Range Dim delRng As Range Dim c As Range Dim nr As Long Dim cond() As Variant Dim i As Long Dim S As Long Dim KeepIt As Boolean S = CLng(Application.InputBox _ ("Qual è il numero degli addetti per l'internaz DIURNO?", Type:=1)) If S < 1 _ Or S 10 Then MsgBox "quitting" Exit Sub End If ReDim cond(1 To S) For i = 1 To S cond(i) = InputBox("Inserire condizione " & i, "tuoTitolo") Next i 'Sheets("INT_GG").Select Set rng = Foglio19.Range("G6:G17") rng.Rows.Hidden = True For Each c In rng.Cells KeepIt = False For i = 1 To S If c.Value = cond(i) Then KeepIt = True 'stop looking End If Next i If KeepIt = True Then 'don't do anything Else If delRng Is Nothing Then Set delRng = c Else Set delRng = Union(c, delRng) End If End If Next c If delRng Is Nothing Then MsgBox "nothing to delete" Else delRng.EntireRow.Delete End If End Sub AND wrote: Hi, by this script, I filter some data except the data filled in inputbox. Now I would delete each data hidden except the data shown Can u help me please? thanks a lot. Private Sub button1_Click() Dim rng As Range Dim c As Range Dim nr As Long Dim cond(10) As Variant Dim i As Integer Dim S As Intege S = InputBox("Qual è il numero degli addetti per l'internaz DIURNO?") Sheets("INT_GG").Select For i = 1 To S cond(i) = InputBox("Inserire condizione " & i, "tuoTitolo") Next Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = True For Each c In rng Select Case c.Value Case Is = cond(1), cond(2), cond(3), cond(4), cond(5), cond(6), cond(7), cond(8), cond(9), cond(10) Foglio19.Rows(c.Row).Hidden = False Case Else End Select Next End Sub Public Sub mScopri1() Dim rng As Range Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = False -- BBB -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check your other post, too.
AND wrote: Hi, by this script, I filter some data except the data filled in inputbox. Now I would delete each data hidden except the data shown Can u help me please? thanks a lot. Private Sub button1_Click() Dim rng As Range Dim c As Range Dim nr As Long Dim cond(10) As Variant Dim i As Integer Dim S As Intege S = InputBox("Qual è il numero degli addetti per l'internaz DIURNO?") Sheets("INT_GG").Select For i = 1 To S cond(i) = InputBox("Inserire condizione " & i, "tuoTitolo") Next Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = True For Each c In rng Select Case c.Value Case Is = cond(1), cond(2), cond(3), cond(4), cond(5), cond(6), cond(7), cond(8), cond(9), cond(10) Foglio19.Rows(c.Row).Hidden = False Case Else End Select Next End Sub Public Sub mScopri1() Dim rng As Range Set rng = Foglio19.Range("G6:G800") rng.Rows.Hidden = False -- BBB -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
filter and delete | Excel Discussion (Misc queries) | |||
Filter and Delete | Excel Worksheet Functions | |||
AFTER 8 SEC ON SPACEBAR I GOT A FILTER?DELETE IT? | Excel Discussion (Misc queries) | |||
Help with Filter and Delete...... Please | Excel Programming | |||
filter and delete | Excel Worksheet Functions |