#1   Report Post  
Posted to microsoft.public.excel.misc
AND AND is offline
external usenet poster
 
Posts: 22
Default filter and delete

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default filter and delete

BBB,

Try it this way:

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 Integer
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 = False 'Changed
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 = True 'Changed
Case Else

End Select
Next

'Added

rng.SpecialCells(xlCellTypeVisible).EntireRow.Dele te
rng.Rows.Hidden = False

End Sub

--
HTH,
Bernie
MS Excel MVP


"AND" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default filter and delete

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
  #4   Report Post  
Posted to microsoft.public.excel.misc
AND AND is offline
external usenet poster
 
Posts: 22
Default filter and delete

Bernie,
u're a genius.
Thank u very much from me and my staff.
u 've solved our issue!!!!!
We're grateful.
--
BBB


"Bernie Deitrick" wrote:

BBB,

Try it this way:

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 Integer
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 = False 'Changed
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 = True 'Changed
Case Else

End Select
Next

'Added

rng.SpecialCells(xlCellTypeVisible).EntireRow.Dele te
rng.Rows.Hidden = False

End Sub

--
HTH,
Bernie
MS Excel MVP


"AND" wrote in message
...
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




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
Filter and Delete lotivbarjoh Excel Worksheet Functions 6 June 30th 08 06:57 PM
AFTER 8 SEC ON SPACEBAR I GOT A FILTER?DELETE IT? Carl Excel Discussion (Misc queries) 2 June 16th 07 02:05 PM
Filter list and delete OfficeNDN Excel Discussion (Misc queries) 4 September 11th 06 04:08 PM
filter and delete Jordan Excel Worksheet Functions 1 July 7th 05 07:18 PM
Fastest Way to Filter/Delete SyrHoop Excel Worksheet Functions 6 November 10th 04 06:33 PM


All times are GMT +1. The time now is 03:57 PM.

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"