VBA: Pull Record Into UserForm

M

Mcasteel

I have 3 more questions for you regarding your solution.

1. SSN
The SSN column is formatted as "Special" / Social Security Number i
the Excel file.

When viewing the SSN: it shows with dashes (123-45-6789) but if I pul
the value from Excel into the form as a string it displays with out th
dashes (123456789) which suites my needs.

After the above experiment Im assuming the ssn is just a string or tex
and not a number.

2. Im not sure If I understand your last line of code, what is the Cln
used for?

iRow = whateveryouchose.match_(*CLNG*(_CustSSN), _
Worksheets("Sheet1").Range("f27:f307"), 0)

3. With this piece of code, I will be able to take values from th
record and display them in my form, correct?

Thanks again, Im working on trying your code right now
 
B

Bob Phillips

1. No that means it is a number, it is just the format that adds the -

2. Clng is coercing it into number in case it is a string.

3. Yes, but you only get the row where a match is found, you still have work
to do.
 
D

Dave Peterson

Just to add to Bob's response.

#1. It looked like you were using some sort of textbox to ask the user what
the SSN to retrieve.

That value in the textbox is text--so you have to make it match the values
(which are numbers formatted pretty) in your data--hence, the clng()
portion.

#2. see #1 <bg>.

#3. Maybe <vbg>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top