Copy 3 lines to a location dependent on selection

Tkeller

Board Regular
Joined
Jul 23, 2003
Messages
143
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello,

I have 3 separate rows of information on one page of my workbook. they are each in a named range (as the cell location may move as I insert lines). I want to paste values for each of these rows to a location on my worksheet based on the user selecting 1-6 in a cell on the inputs page. e.g., if the user selects 1, it will be pated in the destination row, if the user selects 2 it goes in the row right under this, 3 it goes in the row 2 spots below.

Is there a way to do this simply in VBA, perhaps with some kind of relative reference to the initial paste row?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
There is a way, you can create code to use select case condition so that depending on the value of the given cell, a certain action happens.
 
Upvote 0
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of your sheet. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here.
 
Upvote 0
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of your sheet. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here.
Let me make this easier:

I have a paste area with 6 rows in it. Staring with row named "start row"

I have an input cell called "input cell" where the user types in 1,2,3,4,5,6

I have a row called "copy row"

I want to paste this row in row 1,2,3,4,5,6 which are all sequential on the workbook) based on the input value selected
 
Upvote 0
Let me make this easier:

I have a paste area with 6 rows in it. Staring with row named "start row"

I have an input cell called "input cell" where the user types in 1,2,3,4,5,6

I have a row called "copy row"

I want to paste this row in row 1,2,3,4,5,6 which are all sequential on the workbook) based on the input value selected
Here is a link Excel Example.xlsx
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,299
Members
448,885
Latest member
LokiSonic

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