Trying to move a string of data in the row below the first row containing EDI jobs with a Macro

RudeBoy

Active Member
Joined
Feb 2, 2003
Messages
376
I have some data that I did a search on that comes up like this:
EDI#CO01
14 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
EDI#HI01
14 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
EDI#MA01
14 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
EDI#NW01
14 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
EDI#0001
14 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE

PROSE OLD Form.xlsx
E
15
Sheet4


The results should be like this:
PROSE OLD Form.xlsx
E
10
Sheet4
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Not seeing your images properly

1597111561342.png
 
Upvote 0
Let me try again posting it - This is the Data how it is today:
PROSE OLD Form.xlsx
ABCDEFG
214 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
3EDI#HI01
414 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
5EDI#MA01
614 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
7EDI#NW01
814 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
9EDI#0001
1014 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
Sheet1 (2)


This is how I want the data after:
PROSE OLD Form.xlsx
ABCDEFG
1EDI#CO0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
2EDI#HI0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
3EDI#MA0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
4EDI#NW0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
5EDI#000114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
Sheet4
 
Upvote 0
Trying to move a string of data in the row below the first row containing EDI jobs with a Macro


Let me try again posting it - This is the Data how it is today:
PROSE OLD Form.xlsx
ABCDEFG
214 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
3EDI#HI01
414 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
5EDI#MA01
614 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
7EDI#NW01
814 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
9EDI#0001
1014 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
Sheet1 (2)


This is how I want the data after:
PROSE OLD Form.xlsx
ABCDEFG
1EDI#CO0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
2EDI#HI0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
3EDI#MA0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
4EDI#NW0114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
5EDI#000114 C. PURGE ABENDED JOB AND CONTINUE SCHEDULE
Sheet4
 
Upvote 0
Thanks for reposting. Assuming there are no blank rows.

Try this:

VBA Code:
Sub movedata()

Dim rownum As Long

rownum = 1

Do Until Cells(rownum, 1) = ""
    Cells(rownum, 2) = Cells(rownum + 1, 1)
    Rows(rownum + 1).Delete
rownum = rownum + 1
Loop

End Sub
 
Upvote 0
Thanks for reposting. Assuming there are no blank rows.

Try this:

VBA Code:
Sub movedata()

Dim rownum As Long

rownum = 1

Do Until Cells(rownum, 1) = ""
    Cells(rownum, 2) = Cells(rownum + 1, 1)
    Rows(rownum + 1).Delete
rownum = rownum + 1
Loop

End Sub
Awesomeeeeeeeeeeeeeeeeee worked Perfectly - Thank You So Much - Stay Safe - You & The Family
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

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