View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_69_] kkknie[_69_] is offline
external usenet poster
 
Posts: 1
Default New to Excel VBA

A bit of plagerizing from John Walkenbach's book (Excel 2002 Powe
Programming with VBA):

Code
-------------------
Sub Test()
Dim UserRange as Range
DefaultRange = Selection.Address
On Error Goto Cancelled
Set UserRange = Application.InputBox _
(Prompt:="Range to Search:", Title:="Range Search", _
Default:=DefaultRange, Type:=8)
'Add your search using UserRange as the range variable.
Cancelled:
End Su
-------------------

K

P.S. The key is to use the Application.Inputbox rather than jus
InputBox since it gives you the Type option. Type 8 is a range.


--
Message posted from http://www.ExcelForum.com