How to use Cells.Find function to search only in one column?

dduranic

New Member
Joined
Dec 14, 2006
Messages
6
I want to find a content of ActiveCell only in column "C", beginning from cell C4.What must be in Look in, and Look at?How to accomplish to match whole number,ex. "1" in cell with "1",no to find "1" in "123"!

This function searches in whole sheet,but i need only in C column!
Cells.Find(What:=ActiveCell, After:=[c4], LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate

Please,help me!
 
Perhaps this?

Stealing a bit of code, please forgive me: :P
Code:
Sub findit() 
Dim c         As Range
Dim myCell As Range

Set myCell = ActiveCell 'replace with cell where the next column
                                   'has the base value to add to.
                                   'Code assumes search starts at next row.
Set c = Range(myCell.offset(1).address+:C65536").Find _ 
    (What:=ActiveCell, _ 
    LookIn:=xlValues, LookAt:=xlWhole, _ 
    SearchOrder:=xlByRows, SearchDirection:=xlNext, _ 
    MatchCase:=False, SearchFormat:=False) 
If Not c Is Nothing Then 
    myCell.Offset(, 1) = c.Offset(, 1) +myCell.Offset(0,1)
    'Add D value from searched C to D value from initial C.
End Sub
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
That would search after the data, you are also missing an End If.
 
Upvote 0
Yeeees,that the function i needed. :biggrin:
HOTPEPPER,thank you very much!
That is the excel table that is connected with datebase which contains records with products.I use it when we counting the products in shop and checking that their quantity is the same as in the datebase.As we have same products on different places, I need this function to add their quantities.
You have drink when you come to Croatia. :)
 
Upvote 0

Forum statistics

Threads
1,216,561
Messages
6,131,403
Members
449,650
Latest member
Adamd325

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top