Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-29-2008, 09:10 PM
legg
 
Posts: n/a
Removing blank rows

I noted a post in January where someone wanted to insert blank rows in
every other row of a worksheet

I've got the reverse issue.

A database created from a text input has a blank row from the original
double-spacing - but not every second row.

How do I remove blank rows in 50,000 lines of data?

I don't know whether he blank rows carry some baggage from the
conversion - was a copy out of a text file with space-separated values
and double CR between lines (rows).

This is for someone wanting a semiconductor data list that can
eventually be sorted by column values. Will work as is, but is twice
as big as needed.

When currently sorted, the blank rows are not shifted out of the
tables.

RL
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 09:45 PM
Dave Peterson
 
Posts: n/a
Re: Removing blank rows

What happens if you (or that someone) just sorts the data?

Don't the "blanks" get sorted to the top or the bottom--or at least grouped
together?



legg wrote:
>
> I noted a post in January where someone wanted to insert blank rows in
> every other row of a worksheet
>
> I've got the reverse issue.
>
> A database created from a text input has a blank row from the original
> double-spacing - but not every second row.
>
> How do I remove blank rows in 50,000 lines of data?
>
> I don't know whether he blank rows carry some baggage from the
> conversion - was a copy out of a text file with space-separated values
> and double CR between lines (rows).
>
> This is for someone wanting a semiconductor data list that can
> eventually be sorted by column values. Will work as is, but is twice
> as big as needed.
>
> When currently sorted, the blank rows are not shifted out of the
> tables.
>
> RL


--

Dave Peterson
Reply With Quote
  #3 (permalink)  
Old 04-29-2008, 09:57 PM
Gord Dibben
 
Posts: n/a
Re: Removing blank rows

If the rows do not sort out then you are probably correct in surmising some type
of baggage in blank cells.

Sub TRIM_EXTRA_SPACES()
Dim Cell As Range
For Each Cell In Selection
If (Not IsEmpty(Cell)) And _
Not IsNumeric(Cell.Value) And _
InStr(Cell.Formula, "=") = 0 _
Then Cell.Value = Application.Trim(Cell.Value)
Next
End Sub

Note: if the baggage is is the non-breaking space character 160 you can try an
Edit>Replace

what: Alt + 0160 (on numpad)

with: nothing

replace all

When done, F5>Special>Blanks>OK>Edit>Delete>Entire Rows


Gord Dibben MS Excel MVP

On Tue, 29 Apr 2008 16:10:03 -0400, legg <legg@nospam.magma.ca> wrote:

>I noted a post in January where someone wanted to insert blank rows in
>every other row of a worksheet
>
>I've got the reverse issue.
>
>A database created from a text input has a blank row from the original
>double-spacing - but not every second row.
>
>How do I remove blank rows in 50,000 lines of data?
>
>I don't know whether he blank rows carry some baggage from the
>conversion - was a copy out of a text file with space-separated values
>and double CR between lines (rows).
>
>This is for someone wanting a semiconductor data list that can
>eventually be sorted by column values. Will work as is, but is twice
>as big as needed.
>
>When currently sorted, the blank rows are not shifted out of the
>tables.
>
>RL


Reply With Quote
  #4 (permalink)  
Old 04-29-2008, 10:41 PM
legg
 
Posts: n/a
Re: Removing blank rows

On Tue, 29 Apr 2008 15:45:35 -0500, Dave Peterson
<petersod@verizonXSPAM.net> wrote:

>What happens if you (or that someone) just sorts the data?
>
>Don't the "blanks" get sorted to the top or the bottom--or at least grouped
>together?
>

Actually, it's even worse than I thought.

A worksheet won't sort. Tried reversing order (12,000 lines) without
effect.

Text should at least sort in alpha-numerical order, from my
experience.

yow

RL
Reply With Quote
  #5 (permalink)  
Old 04-29-2008, 10:49 PM
Dave Peterson
 
Posts: n/a
Re: Removing blank rows

Are you selecting the range to sort or allowing excel to guess what it should
be.

If you're not selecting the range first, try that. Excel can often guess
wrong--especially with blank rows and/or blank columns.

legg wrote:
>
> On Tue, 29 Apr 2008 15:45:35 -0500, Dave Peterson
> <petersod@verizonXSPAM.net> wrote:
>
> >What happens if you (or that someone) just sorts the data?
> >
> >Don't the "blanks" get sorted to the top or the bottom--or at least grouped
> >together?
> >

> Actually, it's even worse than I thought.
>
> A worksheet won't sort. Tried reversing order (12,000 lines) without
> effect.
>
> Text should at least sort in alpha-numerical order, from my
> experience.
>
> yow
>
> RL


--

Dave Peterson
Reply With Quote
  #6 (permalink)  
Old 04-29-2008, 11:02 PM
legg
 
Posts: n/a
Re: Removing blank rows

On Tue, 29 Apr 2008 13:57:30 -0700, Gord Dibben <gorddibbATshawDOTca>
wrote:

>If the rows do not sort out then you are probably correct in surmising some type
>of baggage in blank cells.
>
>Sub TRIM_EXTRA_SPACES()
>Dim Cell As Range
> For Each Cell In Selection
> If (Not IsEmpty(Cell)) And _
> Not IsNumeric(Cell.Value) And _
> InStr(Cell.Formula, "=") = 0 _
> Then Cell.Value = Application.Trim(Cell.Value)
> Next
>End Sub
>
>Note: if the baggage is is the non-breaking space character 160 you can try an
>Edit>Replace
>
>what: Alt + 0160 (on numpad)
>
>with: nothing
>
>replace all
>
>When done, F5>Special>Blanks>OK>Edit>Delete>Entire Rows
>
>
>Gord Dibben MS Excel MVP


I tried the macro. Got a long wait, but no apparent effect or change
in sorting behavior.

The edit function can't to find the character, in the sheet or
selected lines.

RL
Reply With Quote
  #7 (permalink)  
Old 04-29-2008, 11:05 PM
=?Utf-8?B?RGF2ZQ==?=
 
Posts: n/a
Re: Removing blank rows

Hi,
Do you really have blank XL rows between you data, or do you have a blank
line at the bottom of each XL row?
Dave
Reply With Quote
  #8 (permalink)  
Old 04-29-2008, 11:11 PM
legg
 
Posts: n/a
Re: Removing blank rows

On Tue, 29 Apr 2008 16:49:40 -0500, Dave Peterson
<petersod@verizonXSPAM.net> wrote:

>Are you selecting the range to sort or allowing excel to guess what it should
>be.
>
>If you're not selecting the range first, try that. Excel can often guess
>wrong--especially with blank rows and/or blank columns.


That seemed to do the trick.

With all data selected and specifying a sort by column, the blank
lines got ousted without losing row association.

Many thanks.

RL
Reply With Quote
  #9 (permalink)  
Old 04-29-2008, 11:30 PM
legg
 
Posts: n/a
Re: Removing blank rows

On Tue, 29 Apr 2008 15:05:01 -0700, Dave
<Dave@discussions.microsoft.com> wrote:

>Hi,
>Do you really have blank XL rows between you data, or do you have a blank
>line at the bottom of each XL row?
>Dave


No, it was a new enumerated line, and not grouped or associated with
the preceding line. Selecting all of the data on the page and sorting
by selected column got rid of the blanks in a trial worksheet.

I was used to just having to pick a single column cell to do this
previously.

12000 lines are now 6000 without loss of row associations.

Thanks for the help.

RL
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:47 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Remortgages | Limited Edition Art Print | Mobile Phones | Mortgage | Equity Release



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114