Link to home
Start Free TrialLog in
Avatar of KLMServices
KLMServices

asked on

Add prefix to cells in excel then paste into access.

I have an excel worksheet that which has serveral columns of data, but one particular column has employee numbers that I need to add the prefix "85". When the user enters 12456, it should read 8512456. or if the number is 1234 it should read 8501234. should always have 7 digits. I added a formula in excel to add the prefix 85 but when I copy the data and paste into Access the 85 is removed. How can I make sure that the prefix remains after pasting to access 2007 or is there better way to accomplish this.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Ardhendu Sarangi
Ardhendu Sarangi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KLMServices
KLMServices

ASKER

pari123:

I tried that and that didn't work. It works in Excel 2003 but for some reason in 2007 it doesn't work.
Please verify if you are using the right formula to append the "85" to the numbers?

in Excel 2007, you can use = "85" &A1 in cell B1, assuming the employee numbers are in A1.
can you please post your spreadsheet if that doesn't work?

Also please make sure the cells which contains the formula are not formatted as text. this would not work too.
To cater for 1234 becoming 8501234 the formula would need to be either

=85&TEXT(A1,"00000")

or

=A1+8500000

...but I assumed you have the formula sorted already.....pari's Paste Special > Values option should work OK in any version of Excel, I think. What happened when you tried that in 2007?

barry
Thanks for all the suggestions guys, I left the office early so will give it a shot when I get back in the morning.

Barry: When I used Pari's method, it dropped the 85 but I am sure I did something wrong.  But I will give your solution along side Paris paste special again. Eventually, I want this to all run with a macro and export to Access with one command.

Will report back shortly.

Thanks All
Thanks, suggestions above worked. I just need to figure out how to automate the entire procedure. Thanks