Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Finding and extracting text

0

Hello,

Your 'idiot-proofing forms' series was simply amazing so I decided to get the course! I used that series to create a form for myself. In one of the episodes you mentioned about searching for the ID to return all the information in the database. 

The command you showed:

Set Rng = dataIdCol.Find(What:=SearchValue, _

            LookIn:=xlValues, _

            LookAt:=xlWhole, _

            SearchOrder:=xlByRows, _

            MatchCase:=False)

        If Not Rng Is Nothing Then

How would I restructure or change the code so it pulls out text instead of numerical values? I've tried searching up solutions but am struggling to find the one that works.

Thanks in advance! 

Answer
Discuss

Discussion

Thanks for getting the course! I'm glad you like it!!! I'm not sure exactly what you are trying to do and I'd rather you not post the course files here, but if you use the Contact link at the top of the page, you can message me directly and, once I reply, you can send me the file you are working with and I will help you make the changes.
don (rep: 1989) Jan 28, '22 at 4:27 pm
Also, in case this is what solves your issue, you can put CStr() around anything you want to make sure is seen as text (string). Here is the link to all of the type conversion functions you can use in vba. VBA Type Conversion Functions
don (rep: 1989) Jan 28, '22 at 4:29 pm
Its nothing from the course :) Its just from the publically available videos so no need to worry. I will try your solution on the bottom and give it a try If not I will definitely come back to you through the contact link. Thanks alot Don. 
antwonwes Jan 28, '22 at 4:39 pm
You're welcome!
don (rep: 1989) Jan 28, '22 at 6:43 pm
Add to Discussion



Answer the Question

You must create an account to use the forum. Create an Account or Login