Finding Cells with a Paragraph

kparadise

Board Regular
Joined
Aug 13, 2015
Messages
186
Hello,
I have to download an Excel document from our SOR every week, and then I copy and paste it directly into my Access database. There is one column in the Excel document which CAN contains multiple values which appears to have been entered after a paragraph (see below). Now this copies over to Access fine, but what I am trying to do is create a query in Access which will say; give me all the ID's that contains a Fruit column which a paragraph make (basically, give me all the IDs that have more than one fruit in it).

The character which separates the multiple values is a RETURN within excel and when I copy it over to Access. I found this by simply copy/pasting the cells to Word and then showing the paragraph symbols.

IDFruit
1Apple
2Banana
3Apple
Orange
Kiwi
4Banana
Kiwi

<tbody>
</tbody>
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
try


Code:
select 
  ID, 
  replace(Fruit, Chr(13) & Chr(10), "-") as [Fixed Fruit] 
from 
  table1 
where 
(
  (
    InStr( 1, [table1].[Fruit], chr(10) ) > 0
  )
)

you might have to change the Chr(13) & Chr(10) to be just
Chr(13)
or just
Chr(10)
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,327
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top