Copy paste macro

Am2july

New Member
Joined
Feb 12, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi! I’m totally new to macros
I need help in copying and pasting from 1 sheet to another sheet.

copy cell c19:c30 in sheet 1 that has data to the next available row in sheet 2 column B

Copy Cell O5 from sheet 1 to the next available row in sheet 2 in column A multiple times. the same number times of of data you have in cell c19:c30 in sheet 1e
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
VBA Code:
Sub Test()
  With Worksheets("Sheet2")
  Worksheets("Sheet1").Range("C19:C30").Copy .Cells(Rows.Count, 2).End(xlUp).Offset(1)
  .Range(.Cells(Rows.Count, 1).End(xlUp).Offset(1), .Cells(Rows.Count, 2).End(xlUp).Offset(, -1)).Value = Worksheets("Sheet1").Range("O5").Value
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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