How to use VBA to search for a value on a Worksheet
49.9 هزار بار بازدید -
7 سال پیش
-
How to use VBA to
How to use VBA to search for a value on a Worksheet. Use VBA to find a value on another sheet. How to find a value and retrieve a number from another cell on that row.
Sub findsomething()
Dim rng As Range
Dim account As String
Dim rownumber As Long
account = Sheet1.Cells(2, 1)
Set rng = Sheet2.Columns("A:A").Find(What:=account, _
LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
rownumber = rng.Row
Sheet1.Cells(2, 2).Value = Sheet2.Cells(rownumber, 3).Value
End Sub
For more help visit my website http://www.easyexcelanswers.com or email me at [email protected].
Contact me regarding customizing this template for your needs.
Excel one-on-one on-line training available. Email me to arrange.
I am able to provide online help on your computer at a reasonable rate.
Check out my next one-hour Excel Webinar
https://www.crowdcast.io/easyexcelans...
I use a Blue condensor Microphone to record my videos, here is the link
https://amzn.to/37gyyGa
Check out Crowdcast for creating your webinars
https://app.linkmink.com/a/crowdcast/83
If you need to buy Office 2019 follow
https://amzn.to/2VX5dv8
I use Tube Buddy to help promote my videos
Check them out
https://www.Tubebuddy.com/easyexcelan...
Follow me on Facebook
Facebook: easyexcel.answers
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
http://www.youtube.com/timedtext_cs_p...
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.
Sub findsomething()
Dim rng As Range
Dim account As String
Dim rownumber As Long
account = Sheet1.Cells(2, 1)
Set rng = Sheet2.Columns("A:A").Find(What:=account, _
LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
rownumber = rng.Row
Sheet1.Cells(2, 2).Value = Sheet2.Cells(rownumber, 3).Value
End Sub
For more help visit my website http://www.easyexcelanswers.com or email me at [email protected].
Contact me regarding customizing this template for your needs.
Excel one-on-one on-line training available. Email me to arrange.
I am able to provide online help on your computer at a reasonable rate.
Check out my next one-hour Excel Webinar
https://www.crowdcast.io/easyexcelans...
I use a Blue condensor Microphone to record my videos, here is the link
https://amzn.to/37gyyGa
Check out Crowdcast for creating your webinars
https://app.linkmink.com/a/crowdcast/83
If you need to buy Office 2019 follow
https://amzn.to/2VX5dv8
I use Tube Buddy to help promote my videos
Check them out
https://www.Tubebuddy.com/easyexcelan...
Follow me on Facebook
Facebook: easyexcel.answers
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
http://www.youtube.com/timedtext_cs_p...
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.
7 سال پیش
در تاریخ 1396/08/22 منتشر شده
است.
49,953
بـار بازدید شده