Need help copy data from shee1 to sheet2

muzzy

Active Member
Joined
Apr 8, 2014
Messages
333
I am looking for a Formulas or VBA to copy this to sheet 2. If I have this.

Assigned Role
Assigned
1-2-8-26-1-1-11ARTHUR
1-2-8-26-1-1-11CHARLOTTE
Subtotal
1-2-8-26-1-2-13MARSHALL
1-2-8-26-1-2-13MATTHEW
1-2-8-26-1-2-13PASCAL
Subtotal
1-2-8-26-1-1-12ABRIL
1-2-8-26-1-1-12BRIA
1-2-8-26-1-1-12DIANNA
Subtotal
1-2-8-26-2-2-12JERMELL
Subtotal

<colgroup><col><col></colgroup><tbody>
</tbody>

But this is what I need I need the Subtotal to be removed so it will look like this.

Assigned Role
Assigned
1-2-8-26-1-1-11ARTHUR
1-2-8-26-1-1-11CHARLOTTE
1-2-8-26-1-2-13MARSHALL
1-2-8-26-1-2-13MATTHEW
1-2-8-26-1-2-13PASCAL
1-2-8-26-1-1-12ABRIL
1-2-8-26-1-1-12BRIA
1-2-8-26-1-1-12DIANNA
1-2-8-26-2-2-12JERMELL

<colgroup><col><col></colgroup><tbody>
</tbody>

Please can someone help thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
i would macro record this,
add a filter
select subtotal and delete those rows
turn off filter
select the data,
copy > paste special the values on your new sheet

then you can modify the code / post here between code tags to make it more friendly
 
Upvote 0
Private Sub btnExport_Click()
Dim ws_src As Worksheet, ws_dst As Worksheet
Dim wb_src As Workbook

Set wb_src = ThisWorkbook
Set ws_src = wb_src.Sheets(1)
Set ws_dst = wb_src.Sheets(2)

LastDataRowNr = ws_src.Range("B" & ws_src.Rows.Count).End(xlUp).Row

Dim subTotal As String

subTotal = "Subtotal"

'Get the last filled row number
LastDataRow = ws_src.Range("A" & ws_src.Rows.Count).End(xlUp).Row
rngToCheck = "B2:B" & LastDataRow

For counter = 2 To LastDataRow
deleteRowRng = "B" & counter

If ws_src.Range(deleteRowRng).Value = "Subtotal" Then
ws_src.Rows(counter).Delete
End If
Next

rangeToCopy = "A1:B" & LastDataRow
ws_src.Range(rangeToCopy).Copy
ws_dst.Range(rangeToCopy).PasteSpecial





End Sub
 
Upvote 0
copy just the first two columns from this sheet name (Isell Daily Data) to this sheet name (Daily Dashboard).
 
Last edited:
Upvote 0
you need to edit these

Set ws_src = wb_src.Sheets(1)
Set ws_dst = wb_src.Sheets(2)
 
Upvote 0
Is this what I do?

Set ws_src = wb_src.Daily Dashboard
Set ws_dst = wb_src.Isell Daily Data

It give me a error
 
Upvote 0
try

Set ws_src = sheets("Daily Dashboard")
Set ws_dst = sheets("Isell Daily Data")
 
Upvote 0
I try it. and it copy the info from (Isell Daily Data) sheet to (Daily Dashboard) but it also over write (Isell Daily Data) with the same info that I am asking it to do. I need it only to copy the info from (Isell Daily Data) sheet to (Daily Dashboard) and not over write (Isell Daily Data).

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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