Search cell to paste value

andrebrigoni

New Member
Joined
Oct 9, 2014
Messages
1
Hi guys, good morning!
This is my first thread here at MrExcel.com.
I've been searching the web for help on VBA for the last weeks and learned a lot already!
However, when it comes to using VBA, I can say that I'm still "crawling"!
What I would like to ask you guys is what kind of function I could use to search for the correct cell to paste value from another worksheet.
Trying to make things clearer:
I use excel to register different information on about 5000 people, and I've already created userforms for that.
Some of that information is simply registered on a "next available row basis", while other needs to "match" ID number on a row and type of information on a column so that I can find the correct cell to paste info on.
I've found hundreds of threads using Vlookup or IndexMatch to find cell to copy value from, but never to paste value on.
I'd very deeply appreciate any help you guys could provide me with!
Thank you! :)
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This will find the first instance of what you look for and return the Row it was found on.
I typically know the Column I need to update so once I have the Row I know the cell to place the data.

Code:
Sub SimpleFind()
    Dim fnd As Range
    Dim rngSearchRange As Range
    Dim intRowFoundOn As Integer
    Dim strWhatToFind As String
    
    Set rngSearchRange = Sheets("Sheet1").Range("A:A")
    strWhatToFind = Application.InputBox("Enter String to find")
    
    Set fnd = rngSearchRange.Find(strWhatToFind, , , xlWhole)
    If Not fnd Is Nothing Then
        intRowFoundOn = fnd.Row
        MsgBox strWhatToFind & " was found on Row " & intRowFoundOn & "."
    Else
        MsgBox strWhatToFind & " was not found."
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,628
Messages
6,120,618
Members
448,973
Latest member
ChristineC

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