VBA copy specifc cells in sheet1 to specific cells sheet 2

JMC57

Board Regular
Joined
Apr 24, 2012
Messages
118
I am looking to modify the following code so that only B and D are copied from sheet 2 AND the results are pasted in c and d in sheet 3. Any help will be apprecaited. Thanks

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheets("sheet2").Range("b1:d10000").Copy _
Sheets("sheet3").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Sheets("sheet3").Select
End Sub
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi

Something like this
Code:
Sheets("sheet2").Range("B1:B100,D1:D100").Copy Sheets("sheet3").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0)
Mytå
 
Upvote 0
Hi

Something like this
Code:
Sheets("sheet2").Range("B1:B100,D1:D100").Copy Sheets("sheet3").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0)
Mytå


Hi thank you for the response. To make data consistent with a downloaded report format is there a way to copy the contents of D in sheet 2 to C sheet 3 and B in sheet 2 toD sheet 3 ?

Thanks again.
 
Upvote 0
Hi

With two lines of code.
Code:
Sheets("Sheet2").Range("D1:D100").Copy Sheets("sheet3").Cells(Rows.Count, 3).End(xlUp).Offset(1)
Sheets("Sheet2").Range("B1:B100").Copy Sheets("sheet3").Cells(Rows.Count, 4).End(xlUp).Offset(1)
Mytå
 
Upvote 0

Forum statistics

Threads
1,215,139
Messages
6,123,264
Members
449,093
Latest member
Vincent Khandagale

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