View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default VBA & Conditional Formating issues

OP Posted:
Set MyRange = Application.InputBox _
(Prompt:="Please Select a Data Range
(Block) to Search for", Title:=".", Type:=8)

This works (and the OP stated it works on almost every sheet).

BrianB posted:

Set MyRange = Range(Application.InputBox _
(Prompt:="Please Select a Data Range
(Block) to Search for", Title:=".", Type:=8))

Which raises an error.

???

Also, selecting with application.Inputbox does not change the selection -
not sure what you intended with your first suggestion? Don't prompt, the
user must select the range before running the macro?

--
Regards,
Tom Ogilvy


"BrianB " wrote in message
...
Not familiar with the Excel 2002 InputBox, but AFAIK inputbox only
returns a string.

Your prompt says "please select". If the inputbox allows a range
selection to be made you could presumably use :-
Dim MyRange as Range
Set MyRange=Selection

Otherwise you need to use

Set MyRange = Range(Application.InputBox _
(Prompt:="Please Select a Data Range
(Block) to Search for", Title:=".", Type:=8))


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