PC Review


Reply
Thread Tools Rate Thread

Code for combining text and deleting row for c10 thru entire range

 
 
DavidH56
Guest
Posts: n/a
 
      8th Dec 2007
Excel 2003, I am trying to format a CSV file which has data separated into 2
different rows. I would like to look where column a is null (no text) and
column c has text and where column b from the previous row begins with "38"

for example

10 A B C
D
11 Harris 38bqw Open Window and apply Complete
12 adhesive to edges


I would like add c12 to the end of c11, delete c12 and loop same for entire
range on sheet. Range is usually not more than 1000 rows.

Thanks in advance.
--
By persisting in your path, though you forfeit the little, you gain the
great.

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      8th Dec 2007
Sub cobineRows()

RowCount = 1
Do While Range("C" & RowCount) <> ""
If Range("A" & (RowCount + 1)) = "" And _
Range("C" & (RowCount + 1)) <> "" Then

Range("C" & RowCount) = _
Range("C" & RowCount) & _
Range("C" & (RowCount + 1))
Rows(RowCount + 1).Delete
End If
RowCount = RowCount + 1
Loop

"DavidH56" wrote:

> Excel 2003, I am trying to format a CSV file which has data separated into 2
> different rows. I would like to look where column a is null (no text) and
> column c has text and where column b from the previous row begins with "38"
>
> for example
>
> 10 A B C
> D
> 11 Harris 38bqw Open Window and apply Complete
> 12 adhesive to edges
>
>
> I would like add c12 to the end of c11, delete c12 and loop same for entire
> range on sheet. Range is usually not more than 1000 rows.
>
> Thanks in advance.
> --
> By persisting in your path, though you forfeit the little, you gain the
> great.
>

 
Reply With Quote
 
DavidH56
Guest
Posts: n/a
 
      8th Dec 2007
Thank you Joel. Works great.
--
By persisting in your path, though you forfeit the little, you gain the
great.



"Joel" wrote:

> Sub cobineRows()
>
> RowCount = 1
> Do While Range("C" & RowCount) <> ""
> If Range("A" & (RowCount + 1)) = "" And _
> Range("C" & (RowCount + 1)) <> "" Then
>
> Range("C" & RowCount) = _
> Range("C" & RowCount) & _
> Range("C" & (RowCount + 1))
> Rows(RowCount + 1).Delete
> End If
> RowCount = RowCount + 1
> Loop
>
> "DavidH56" wrote:
>
> > Excel 2003, I am trying to format a CSV file which has data separated into 2
> > different rows. I would like to look where column a is null (no text) and
> > column c has text and where column b from the previous row begins with "38"
> >
> > for example
> >
> > 10 A B C
> > D
> > 11 Harris 38bqw Open Window and apply Complete
> > 12 adhesive to edges
> >
> >
> > I would like add c12 to the end of c11, delete c12 and loop same for entire
> > range on sheet. Range is usually not more than 1000 rows.
> >
> > Thanks in advance.
> > --
> > By persisting in your path, though you forfeit the little, you gain the
> > great.
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Text from 2 Columns into 1 then Deleting the 2 Columns =?Utf-8?B?c2xlZXBpbmRvZ2c=?= Microsoft Excel Worksheet Functions 5 19th Sep 2008 12:36 AM
combining values and text to make a reference for "named range" devo.uk Microsoft Excel Worksheet Functions 4 10th Jun 2008 10:31 AM
Code for deleting entire row gregork Microsoft Excel Programming 2 4th Jul 2004 12:13 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Microsoft Excel Programming 1 15th Apr 2004 08:34 PM
Re: Deleting All Range Names with VBA Code Charles Williams Microsoft Excel Misc 0 7th Oct 2003 06:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.