Copying multiple columns based on header name dynamically through input box

vinmam123VBA

New Member
Joined
Dec 18, 2020
Messages
19
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

Can any one please help on below requirements:

I have source data where I have two sections(One Actual time other Input time).Please refer the below screenshot.

1608850015598.png


Would like to copy multiple months column data from "Actual time" and "Input time" and paste in destination sheet in column "P" and "R" respectively

Some time I need to copy and paste for few months(Example three months and some time four months and some time two months)

Can I input months name in input box and then do copy paste.

For example if I want to copy for months Oct'20,Nov'20 and Dec'20 (from both Actual time and Input time from source data-Above screenshot for your kind reference) and paste the data in column "P" and column "R" in the destination file.

Regards,
Vin
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

PeteWright

New Member
Joined
Dec 20, 2020
Messages
23
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
Hi,

could you give an example input and output?
I don't understand, what your're trying to do.
Thanks
 

vinmam123VBA

New Member
Joined
Dec 18, 2020
Messages
19
Office Version
  1. 2019
Platform
  1. Windows
Hi

Thank you for the response!

Please find below screenshot:

1608958682122.png

Would like to copy actual time and Input time (Any number of months dynamically) from Source data and paste in Destination file column P(Actual time) and column R(Input time) and Column A(Month in format of Jan'20)




Regards,
Vin
 

PeteWright

New Member
Joined
Dec 20, 2020
Messages
23
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
Hi Vin,
Happy New Year!

I've created a Workbook with some sample data that does what you wanted.
But there are a few limitations:
  • it only copies those rows where data is found in the first column (A), starting with Cell A4 until first blank Cell in Column A in the Source Data Worksheet
  • right now the copy process deletes all data from Destination Data Worksheet and pastes the new data in the Destination Data Worksheet
You may want a different behavior, but for this to work I need a little more information on your data, which you may provide in an answer.

Until then, here's the Excel file:
MrExcel_vinmam123VBA_datacopy.xlsm

You need to download it to your computer and enable macros in order to use it.

Regards
Pete
 

Watch MrExcel Video

Forum statistics

Threads
1,126,953
Messages
5,621,799
Members
415,857
Latest member
braunReivn

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
Top