Re: Match Inputbox Value on Values in Column
From: van (a_at_fred.com)
Date: 02/22/05
- Next message: keilan.knight_at_gmail.com: "Re: Calling Macros from another *** without any hard coded references"
- Previous message: donna.gough_at_hydro.com: "Re: URGENT problem with Autofill in a macro"
- In reply to: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Next in thread: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Reply: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Feb 2005 13:52:31 -0000
Thanx Tom
The column stores numbers with a leading zero.
The code attached does not match up the list of numbers and copy them to a
separate location. Any ideas?
Thx
"Tom Ogilvy" <twogilvy@msn.com> wrote in message
news:OWc2e0DGFHA.1740@TK2MSFTNGP09.phx.gbl...
> 00 is really a number. If you enter 00 and treat it as a number, then it
> would be 0. So does your column Store numbers with formatting to show a
> leading zero, or does you column contain Text.
>
> one way
>
> Sub FindCells()
> Dim ans as String, cell as Range
> Dim rng as Range
> ans = InputBox("Enter value")
> for each cell in Range("A1",Cells(rows.count,1).End(xlup))
> if cell.Text = ans then
> if rng is nothing then
> set rng = cell
> else
> set rng = union(rng,cell)
> end if
> end if
> Next
> if not rng is nothing
> rng.Select
> End if
> End Sub
>
>
>
>
> --
> Regards,
> Tom Ogilvy
>
> "van" <a@fred.com> wrote in message
> news:%23Kzd5WDGFHA.1260@TK2MSFTNGP12.phx.gbl...
> > I have an inputbox function, which requests a particular number (00 to
> 012)
> > from the user. I also have a column in excel which contains random
> numbers
> > in this range.
> >
> > When the user enters a number I would like to be able to match this
input
> to
> > the column of numbers, and extract those which match the input. Any
ideas
> ?
> >
> >
>
>
- Next message: keilan.knight_at_gmail.com: "Re: Calling Macros from another *** without any hard coded references"
- Previous message: donna.gough_at_hydro.com: "Re: URGENT problem with Autofill in a macro"
- In reply to: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Next in thread: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Reply: Tom Ogilvy: "Re: Match Inputbox Value on Values in Column"
- Messages sorted by: [ date ] [ thread ]