View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
green fox green fox is offline
external usenet poster
 
Posts: 16
Default input box - user selects range with mouse?

On Nov 1, 7:51 am, green fox wrote:
On Nov 1, 7:29 am, green fox wrote:

I have an input box where the user is prompted to enter a range to
search for a particular character. In this case a "|". Upon finding
it, its column will be hidden. I would like to have the option to
either type in the range, or use the mouse to select the range.


BTW, I spent two hours debugging this codelet yesterday - tearing my
hair out - turns out my vision was the problem, my code was right from
the start, except for "entireoolumn" AAARGH!


appreciate any help


Andrew J. Fox


Sorry for the trouble, after the posting I was browsing recent topics
and stumbled on an answer. Thanks ossiemac.
The subject line was:

Macro to filter rows containing user defined data

What an amazing - and often humbling - resource this is!

ajf


Just realized I didn't post my code, what an idiot. FYI here it is,
including ossiemac's contribution:

Sub HideColumnIf()
Dim acell, pr

On Error Resume Next
Set pr = Application.InputBox(Prompt:= _
"Please select a range with your Mouse.", _
Title:="SPECIFY RANGE", Type:=8)
On Error GoTo 0


For Each acell In pr

If acell.Text = "|" Then acell.EntireColumn.Hidden = True

Next acell



End Sub


thanks again,

ajf