Transfer Data from a sheet to another sheet dependent on sheet name

max8719

Board Regular
Joined
Jan 9, 2015
Messages
71
Hi Guys,

I need to transfer a row of data from "sheet1" for example B11:P11 to another sheet in the work book. The data in column B11:B170 will define sheet names. So the macro can use this to reference which sheet the row of data needs transferring to. The row of data also need to go into the next available blank row on the specific work sheet and into the same row range eg B11:P11, B12:P12 etc etc.......

This will be assigned to a Active X command button.

Thanks in advance for your feedback.
 
Column B has a drop box function which you can select sheet names would the drop box / data validation conflict with the script?

Also just to get some clarification , will the script avoid making duplicates in the destination sheet.

And is it possible to apply this to a command button click function?

Thanks for your help.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I would test this script on a small set of data.
Create a sheet named "George" and a sheet named "Bob"
Then put the value "George" in column "B" of row one and put "Bob" in column "B" of row two.
Then change the script to say:
For I= 1 to 2

This will test the script. It works for me.
Data validation should not cause a problem.
If you get this working we will later talk about duplicates.
I like solving one problem at a time.
This script will run from a shape or button or whatever.
For now try running it from the ribbon "View" Macro" section of the ribbon.
 
Upvote 0
Hi I have tried this on a new blank excel work book and the error comes up that the script is out of range.

All sheets names and names in column B match. I really hope we can get this working, like yours is.
 
Upvote 0
And your master data sheet is sheet (1) which is the sheet to the far left on your tab menu is that correct? In your original post you said sheet(1).
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,875
Members
449,476
Latest member
pranjal9

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