Import Range

  • Thread starter Thread starter Leo
  • Start date Start date
L

Leo

Hi -

I am trying to figure out how to do the following task.

I need to import the an excel range into a column in
Access.

The range 'Part_Number' is entered as '123-456-789' in
excel. However, the field type in my Access table is
defined as 'Number' (I can't change this).

How do I import this range such that '123456789' is
imported instead of '123-456-789'?

I am using the following code:
!PartNumber = xlssheet.range("Part_Number")

But this gives me an error.

Is there a solution out there for my problem??

Please advise! Thanks!!
 
Hi Leo,

If
!PartNumber = xlssheet.range("Part_Number")
works apart from the formatting of the number, try something like

!PartNumber = CLng(Replace(xlssheet.Range("Part_Number").Value,
"-", ""))
 
JOHN YOU ROCK IT WORKS!! THANKS!!!

-----Original Message-----
Hi Leo,

If
!PartNumber = xlssheet.range("Part_Number")
works apart from the formatting of the number, try something like

!PartNumber = CLng(Replace(xlssheet.Range ("Part_Number").Value,
"-", ""))


Hi -

I am trying to figure out how to do the following task.

I need to import the an excel range into a column in
Access.

The range 'Part_Number' is entered as '123-456-789' in
excel. However, the field type in my Access table is
defined as 'Number' (I can't change this).

How do I import this range such that '123456789' is
imported instead of '123-456-789'?

I am using the following code:
!PartNumber = xlssheet.range("Part_Number")

But this gives me an error.

Is there a solution out there for my problem??

Please advise! Thanks!!

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top