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.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Fruit[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Apple
Orange
Kiwi
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Banana
Kiwi
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,225,613
Messages
6,186,004
Members
453,334
Latest member
Prakash Jha

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