#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Input box

Hello

I would like to use an input box to find in my excel data base some
information.
I have been able to create the input box and the vba code to find a word or
the sentence but if i put both together it doesn't work anymore.
Could you please help me.

The code which i have create is as follow:

Sub Find()

Dim rangeCel As Range
Dim compt As Integer
Dim fin As String

fin = Application.InputBox(Prompt:="KUNDE", Type:=2)
ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
[H14].Value & "*"

End Sub

Thanks a lot

Inès
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Input box

Hi,
The result from the inputbox is stored in the fin variable. Yous should
replace [H14].value with "fin" and it should work perfect.

ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
fin & "*"

if you have a changing number of rows in your database, you can make it more
dynamic by:
ActiveSheet.Range("$A$15).CurrentRegion.AutoFilter Field:=1, Criteria1:="=*"
& fin & "*"

this will only work, if you have no empty rows in your data. Furthermore
range("A14:N14) shoud be empty cells to avoid these to be included into the
currentregion.

br
Lazzzx

"inès" skrev i meddelelsen
...
Hello

I would like to use an input box to find in my excel data base some
information.
I have been able to create the input box and the vba code to find a word
or
the sentence but if i put both together it doesn't work anymore.
Could you please help me.

The code which i have create is as follow:

Sub Find()

Dim rangeCel As Range
Dim compt As Integer
Dim fin As String

fin = Application.InputBox(Prompt:="KUNDE", Type:=2)
ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
[H14].Value & "*"

End Sub

Thanks a lot

Inès


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input box

Hi, Inès

You can use the cod follow, to look for words and mark the same sentences
with other color:

Sub FindText()
Dim strText As String
Dim rngReturn As Range
Dim strFirst As String

strText = InputBox("Enter the texto to look for", "Find Text")
Set rngReturn = Range("a2:i3000").Find(strText, LookIn:=xlValues)

If Not rngReturn Is Nothing Then
strFirst = rngReturn.Address
Do
rngReturn.Interior.Color = vbYellow
Set rngReturn = Range("a2:i3000").FindNext(rngReturn)
Loop While Not rngReturn Is Nothing And CStr(rngReturn.Address) <
strFirst
End If
End Sub

Sorry my english, because i don't speak very well!!!!

bye!!!


"inès" wrote:

Hello

I would like to use an input box to find in my excel data base some
information.
I have been able to create the input box and the vba code to find a word or
the sentence but if i put both together it doesn't work anymore.
Could you please help me.

The code which i have create is as follow:

Sub Find()

Dim rangeCel As Range
Dim compt As Integer
Dim fin As String

fin = Application.InputBox(Prompt:="KUNDE", Type:=2)
ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
[H14].Value & "*"

End Sub

Thanks a lot

Inès

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Input box

Hello Rodrigo F Rodrigues

Thanks for the macro. But i still have a small problem, i should sort out
all the cells with the content of the input box. It i write "Hello" in the
input box i should see all the cells with the word "Hello". But of course if
the cells text is "Louis say Hello" it should appear also.

Thanks a lot

Louis

"Rodrigo F Rodrigues" wrote:

Hi, Inès

You can use the cod follow, to look for words and mark the same sentences
with other color:

Sub FindText()
Dim strText As String
Dim rngReturn As Range
Dim strFirst As String

strText = InputBox("Enter the texto to look for", "Find Text")
Set rngReturn = Range("a2:i3000").Find(strText, LookIn:=xlValues)

If Not rngReturn Is Nothing Then
strFirst = rngReturn.Address
Do
rngReturn.Interior.Color = vbYellow
Set rngReturn = Range("a2:i3000").FindNext(rngReturn)
Loop While Not rngReturn Is Nothing And CStr(rngReturn.Address) <
strFirst
End If
End Sub

Sorry my english, because i don't speak very well!!!!

bye!!!


"inès" wrote:

Hello

I would like to use an input box to find in my excel data base some
information.
I have been able to create the input box and the vba code to find a word or
the sentence but if i put both together it doesn't work anymore.
Could you please help me.

The code which i have create is as follow:

Sub Find()

Dim rangeCel As Range
Dim compt As Integer
Dim fin As String

fin = Application.InputBox(Prompt:="KUNDE", Type:=2)
ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
[H14].Value & "*"

End Sub

Thanks a lot

Inès

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Input box

Dear Lazzzx

Thanks a lot, now it work

"Lazzzx" wrote:

Hi,
The result from the inputbox is stored in the fin variable. Yous should
replace [H14].value with "fin" and it should work perfect.

ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
fin & "*"

if you have a changing number of rows in your database, you can make it more
dynamic by:
ActiveSheet.Range("$A$15).CurrentRegion.AutoFilter Field:=1, Criteria1:="=*"
& fin & "*"

this will only work, if you have no empty rows in your data. Furthermore
range("A14:N14) shoud be empty cells to avoid these to be included into the
currentregion.

br
Lazzzx

"inès" skrev i meddelelsen
...
Hello

I would like to use an input box to find in my excel data base some
information.
I have been able to create the input box and the vba code to find a word
or
the sentence but if i put both together it doesn't work anymore.
Could you please help me.

The code which i have create is as follow:

Sub Find()

Dim rangeCel As Range
Dim compt As Integer
Dim fin As String

fin = Application.InputBox(Prompt:="KUNDE", Type:=2)
ActiveSheet.Range("$A$15:$n$500 ").AutoFilter Field:=1, Criteria1:="=*" &
[H14].Value & "*"

End Sub

Thanks a lot

Inès



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
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 12:21 PM.

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"