Hi I am trying to split up data. I need to cut and paste rows from the sheet DUMP to 2 other sheets.
In column AR the rows are marked with Inbound, Outbound or E-mail. I need the rows with Outbound and E-mail in the sheets Outbound and Email. But they have to paste rows in the next empty row.
I found some VBA coding which I tried to modify a bit, but it seems there is nothing happening... SO who can help me out.
this is the code:
[pre]<br />
Sub emailoutbound()</p>
<p> 'Determine destination sheetname<br />
If AR = "Outbound" Then ShtName = "Outbound"<br />
If AR = "E-mail" Then ShtName = "Email"</p>
<p> 'Find it's last used row<br />
LastRowUsed = Sheets(SntName).UsedRange.Rows.Count</p>
<p> 'Copy current row to next empty row on destination sheet<br />
Rows(R).Select<br />
Selection.Cut<br />
Sheets(ShtName).Select<br />
Rows(LastRowUsed + 1).Select<br />
ActiveSheet.Paste</p>
<p> 'Return to my sheet and go to next row<br />
Sheets("DUMP".Activate<br />
R = R + 1</p>
<p>End Sub<br />
[/pre]
In column AR the rows are marked with Inbound, Outbound or E-mail. I need the rows with Outbound and E-mail in the sheets Outbound and Email. But they have to paste rows in the next empty row.
I found some VBA coding which I tried to modify a bit, but it seems there is nothing happening... SO who can help me out.
this is the code:
[pre]<br />
Sub emailoutbound()</p>
<p> 'Determine destination sheetname<br />
If AR = "Outbound" Then ShtName = "Outbound"<br />
If AR = "E-mail" Then ShtName = "Email"</p>
<p> 'Find it's last used row<br />
LastRowUsed = Sheets(SntName).UsedRange.Rows.Count</p>
<p> 'Copy current row to next empty row on destination sheet<br />
Rows(R).Select<br />
Selection.Cut<br />
Sheets(ShtName).Select<br />
Rows(LastRowUsed + 1).Select<br />
ActiveSheet.Paste</p>
<p> 'Return to my sheet and go to next row<br />
Sheets("DUMP".Activate<br />
R = R + 1</p>
<p>End Sub<br />
[/pre]