ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA: Pull Record Into UserForm (https://www.excelbanter.com/excel-programming/314792-vba-pull-record-into-userform.html)

Mcasteel[_10_]

VBA: Pull Record Into UserForm
 

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

--
Mcastee
-----------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...fo&userid=1569
View this thread: http://www.excelforum.com/showthread.php?threadid=27247


Bob Phillips[_6_]

Pull Record Into UserForm
 
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.

--

HTH

RP

"Mcasteel" wrote in message
...

I have 3 more questions for you regarding your solution.

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

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

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

2. Im not sure If I understand your last line of code, what is the Clng
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 the
record and display them in my form, correct?

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


--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile:

http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=272475




Dave Peterson[_3_]

VBA: Pull Record Into UserForm
 
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.


Mcasteel wrote:

I have 3 more questions for you regarding your solution.

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

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

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

2. Im not sure If I understand your last line of code, what is the Clng
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 the
record and display them in my form, correct?

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

--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=272475


--

Dave Peterson



All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com