VBA to copy a range to another sheet

Kiwi den

Board Regular
Joined
Feb 17, 2014
Messages
143
Office Version
  1. 365
Platform
  1. Windows
Looking for VBA code
Start with deleting data in Sheet1 A1 - E1, so I can enter new data
Then I want to copy a range from sheet1 (A1 - E1) to sheet2 starting in A1 - E1,
then when data in sheet 1 changes, it copies to sheet2 in the next available row

Thanks in advance
 

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.
Upvote 0
VBA Code:
Sheets("from")

The "from" is the name of the sheet that is being copied. Change FROM to the name of the sheet as shown on the sheet tab. For example : Sheet1

Do the same for the Sheets("to"). Change the TO ... to the name of the sheet where the data is being pasted. For example : Sheet2
 
Upvote 0
testing option 2021.xlsm
ABCDEFGHIJKLMNOPQRS
1ORDER NUMBERDATESUPPLIERCUSTOMERCUSTOMER O/NPRODUCTPRODUCT CODEQTYPRODUCTPRODUCT CODEQTYPRODUCTPRODUCT CODEQTYPRODUCTPRODUCT CODEQTYEmailedDate Arrived
212345678910111213141516171819
from
Cells with Data Validation
CellAllowCriteria
R1ListEmailed,Telephone,Hand Delivered




I have renamed sheets to reflect the code ( sheet1 = "from") Sheets 2 = "to")
 
Upvote 0
You'll need to be more descriptive of what is happening on your end. A simple YES or NO does not give any description of the problem.
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

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