carriage returns

R

Ryan

I know that you can press Alt-Enter to manually put a
carriage return into a cell, but I'm trying to import data
into excel from a webpage that should all be in one cell,
with carriage returns for each line (it's an address
block). No matter what I do, the data will either show up
in separate cells, or as one continuous line without
breaks.

Does anybody know a way to code an excel carriage return?
 
D

David McRitchie

Hi Ryan,
Answer to second part is CHAR(10) when concatenating strings
within a formula, or as you already mentioned Alt+Enter.

In VBA it is CHR(10). This is a line feed (LF) character.

For the first part which seems to be the opposite, you want
to copy and paste from a web page and are getting data into
separate rows. Sounds like you have Excel 95, this gets a
lot better through later versions. To fixup your data the
xxxxxx macro may help. (sorry forgot about this and have to
shut donw now).
 
D

David McRitchie

Hi Ryan,
For the first part see if DEL95HTMLemptyCells in
Delete Cells/Rows in Range, based on empty cells, or cells with specific values
http://www.mvps.org/dmcritchie/excel/delempty.htm
is of interest to you, it does not match what you are saying,
but it fixes a kind of problem that used to be much more prevalent.

It shows how something from HTML used
to look when pasted into Excel 95 with lots of empty cell.
The macro helps you delete the extra cells so that you have your
data again on the proper rows. It is sometimes useful with
Excel 2000, but Excel 2000 usually doesn't have such problems
with most data..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top