LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Creating Parameter Fields

Sub DeleteAllBut()
Dim myRange As Range
Dim Date1 As Date
Dim Date2 As Date
Dim NumRows As Integer
Dim Counter As Integer

Set myRange = Range("D2:D" &
ActiveSheet.Range("D65536").End(xlUp).Row)

NumRows = myRange.Rows.Count

'No error checking here. If you put in a weird date, Excel will try
to interpret
'whatever you type in and you could end up deleting everything.
Date1 = InputBox("Enter starting date: ", "Starting Date")
Date2 = InputBox("Enter ending date: ", "Ending Date")

For Counter = NumRows + 1 To 1 Step -1

If Range("D" & Counter).Value < Date1 Or Range("D" & Counter).Value
Date2 Then
Range("D" & Counter).EntireRow.Delete
End If
Next Counter

End Sub

 
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
Creating a pricing table - with 2 input fields. Big Bad Nige Excel Discussion (Misc queries) 2 November 15th 07 10:06 AM
Creating a PDF will fillable fields Brad Excel Discussion (Misc queries) 3 April 27th 07 09:29 PM
Creating a number from different fields. chzabel Excel Worksheet Functions 3 August 25th 06 02:12 PM
Help Please! - Creating Function Calculated Fields within Pivot Tables ColinS Excel Worksheet Functions 0 April 5th 06 11:19 AM
Creating mandatory fields(cells)... SeattleKurt Excel Worksheet Functions 1 August 31st 05 09:53 PM


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