Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Good morning, I need to import a large spreadsheet into Access 2000 from Excel 2000. I have already done a couple of test runs, and the only problem I have is that many of the cells in Excel have comments as well as data. The data transfers fine, but the comments get dropped. Does anyone know how I can import these comments along with the rest of the data? Thanks for any help!
Rex

Hi Rex
Access is trying to define the column that the data is in as a data field, and by doing so is trying to decide on a type. Thats reasonable as its a database, not a spreadsheet. The type it is choosing is a numerical type (Integer, Single, Double, etc) and so text has no place and is ignored.
I'd recommend one of two routes:
1) Define the field (during import) as a text field. It will pull everything in, but it will be text from then on, so you won't be able to use it for numerical functions without doing conversions.
2) Split the data in your Excel sheet into 2 columns. 1 for the data, and one for the comments. This is pretty easily done - and Access will handle both much more efficiently.
Cheers
Tom

Just re-read your post - if your comments are not normal text, but are comments (as Excel defines them) then do the following:
Copy your data, then choose a fresh column, right click a cell and choose Paste Special. Then, from the pop-up box, select Comments only.
Then open your VBA editor (Alt + F11) and paste this in:
Sub ConvertComments()
Dim xCell As Range
For Each xCell In Selection
If xCell.Comment.Text <> "" Then xCell = xCell.Comment.Text
Next xCell
End SubThen hit F5 to run it (you may need to reselct the comments range, and you may also need to ensure that the cursor is within the body of the macro text)
Then you can delete the text and close the VBA editor
NOW your comments will be recognisable by Access!Hope that helps if the above didn't
Tom

Thanks Tom, you have it right in your second post. Users have added comments in at least 3 columns of the spreadsheet I am trying to import. It is a huge PO log. Anyways, I will give this a try and hope for the best. Thank you for following up and giving me some help.
Take it easy,
Rex

Tom, I just found out that I do not know anything about the VBA editor. I opened it up to paste the information, but I didn't see anywhere to paste. What am I missing?

Choose "Insert Module" and you should get a blank "notepad" style sheet. Paste there. Next, click somewhere in the middle of the pasted text, then hit F5.
It will convert comments to contents for every cell that you have selected on the active sheet of the active book. So you can run it (with F5) as many times as you like. JUST BE CAREFUL NOT TO SELECT THE ORIGINAL CELLS (the ones with data AND comments) WHEN YOU RUN THIS MACRO. If you do this, you will re-write the comments back over the data!
Hope that helps a bit moreTom

Tom, thanks for the help. I wasn't able to use the editor, because the workbook was shared. As soon as I took the share off, I was able to use the editor and run your Macro. It worked good!
Take it easy,
Rex

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |