ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code for combining text and deleting row for c10 thru entire range (https://www.excelbanter.com/excel-programming/402446-code-combining-text-deleting-row-c10-thru-entire-range.html)

DavidH56

Code for combining text and deleting row for c10 thru entire range
 
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.


joel

Code for combining text and deleting row for c10 thru entire range
 
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.


DavidH56

Code for combining text and deleting row for c10 thru entire r
 
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.



All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com