Take values from different area of a column with a variable range lenght

RIC63

New Member
Joined
Jan 12, 2015
Messages
5
I would like to take some values from specific position of a column and paste it in adiacent columns, the number of values to taken can vary then i'm looking for a macro that take as input ( via an input box or directly through a value placed in a cell ) the desired value to use as lenght of range.

for istance :

es. starting from K3 and going down of 3 cells (up to K5) and starting from K17 and going up of 3 cells (up to K15) start point and directions are fixed ....herebelow a small portion of code about wath i have made using the 'record macro' function but clearly far from giving me the desired result...


Sub Auto1()
'
' Auto1 Macro
'
Range("K3:K5").Select
Application.CutCopyMode = False
Selection.Copy
Range("AP4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K15:K17").Select
Range("K17").Activate
Application.CutCopyMode = False
Selection.Copy
Range("AQ4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub

I apprieciate any suggestion
Thanks in advance
riccardo
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Watch MrExcel Video

Forum statistics

Threads
1,123,158
Messages
5,600,054
Members
414,357
Latest member
Gemma_R

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