Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default input box - user selects range with mouse?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default input box - user selects range with mouse?

Hi Andrew,

This example out of code I have been helping someone else with.

Dim rng2 as Range

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

If rng2 Is Nothing Then
MsgBox "User cancelled" _
& Chr(13) & "Processing will terminate"
Exit Sub
End If


Regards,

OssieMac

"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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default input box - user selects range with mouse?

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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

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
Need an input box when user selects a value in a drop down box Susan Excel Worksheet Functions 4 September 8th 08 06:14 PM
Capture the range a user selects and put in textbox. Drew[_9_] Excel Programming 2 March 31st 06 04:02 PM
pause macro until user selects correct range JCIrish Excel Programming 6 March 18th 06 09:26 PM
Prompt For User Mouse Input In Macro? oBis Excel Programming 0 May 6th 04 02:50 PM
User selects a range Wesley[_2_] Excel Programming 2 January 25th 04 09:06 PM


All times are GMT +1. The time now is 06:25 AM.

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"