How can VBA be used to import certain ranges of data from one sheet to another depending on the value of a cell in the Active sheet

Status
Not open for further replies.

Ayugma

New Member
Joined
Nov 20, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have the three sheets:

1) Feed Configurator
2) Data Sheet
3) 14ft Short

The Feed Configurator contains ActiveX controls with some macros that create the 3) sheet but isn't necessarily useful in this case.

The 2) sheet has all the data required for the 3) sheet.

When the Hand of Feed value (or cell D2) is "L", the Left Hand cells (from sheet 2) ) should be imported into sheet 3). When the Hand of Feed value (or cell D2) is "R", then the Right Hand cells (from sheet 2) ) should be imported into sheet 3).

Thank you for your assistance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
if wsHandofFeed.Range("D2") = "L"
Take data from sheet 2 (left range) for new sheet 3
end if
if wsHandofFeed.Range("D2").value = "R"
Take data from sheet 2 (right range) for new sheet 3
end if

HTH
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,897
Messages
6,122,148
Members
449,066
Latest member
Andyg666

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