Solved

Add prefix to cells in excel then paste into access.

Posted on 2011-03-08
8
376 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:KLMServices
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 20

Accepted Solution

by:
Ardhendu Sarangi earned 250 total points
ID: 35072954
" 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."

Before you copy and paste in Access, try this -

1. Copy the entire column with your formula,
2. keeping the column selected go to Paste Special and select "values".
3. Click OK. this will convert the formulas in your column to values which can then be pasted in ACCESS,

HTH,
Ardhendu
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 250 total points
ID: 35073104
If your original numbers are in A2:A100 then you can add the 85 prefix like this:

Type 8500000 in any empty cell
Copy that cell
Select range of original numbers (A2:A100)
Edit > Paste Special "Add"
OK
ESC

that will convert the numbers "in situ" ....and you should be able to export them.....

regards, barry
0
 

Author Comment

by:KLMServices
ID: 35073293
pari123:

I tried that and that didn't work. It works in Excel 2003 but for some reason in 2007 it doesn't work.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 20

Expert Comment

by:Ardhendu Sarangi
ID: 35073361
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.
0
 
LVL 20

Expert Comment

by:Ardhendu Sarangi
ID: 35073379
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.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35073486
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
0
 

Author Comment

by:KLMServices
ID: 35080155
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
0
 

Author Closing Comment

by:KLMServices
ID: 35095150
Thanks, suggestions above worked. I just need to figure out how to automate the entire procedure. Thanks
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question