Vlookup copy/paste with changes. VBA Code?

clfletch

New Member
Joined
Feb 5, 2016
Messages
1
Hi,

I don't really know anything about programming or VBA, but I am trying to learn.

Right now, I have a column that has data in it from a vlookup. I'd like to copy and paste this vlookup equation/code into the next column but change the range and one of the numbers for the whole column. I don't want to have to do this manually. Is there a way to automate this?

=VLOOKUP(Sheet1!B2,'TI Stats 2000-2015'!$A$20:$AV$28,3,FALSE)

I want that in the second column, but I want B2 to remain the same and to carry down like B3 on the next row, etc. And, I want the range to go from A34 to A42 instead. And, I want to change the number 3 to a 5.

Is there a way to do this quickly? And is there a way too repeat it for the next column where I will change the range yet again and change the 5 to an 8?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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