View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Leigh Douglass[_2_] Leigh Douglass[_2_] is offline
external usenet poster
 
Posts: 11
Default Copy + paste macro

Hi

I have a table of data with 12 column headings P1 YTD through to
P12 YTD, these refer to the month in the year. For my current month,
currently P9 YTD, the column has a vlookup to populate the data. I have a
cell where I enter the current period, which is part of another formula.
When i change that cell to P10 YTD, I would like a macro to copy the vlookup
and paste the values for the column heading P9 YTD, and when i change the
cell to P11 YTD, i would like the macro to copy and paste the P10 YTD
heading, etc. I have all my vlookups in place for all periods, but once a
period has ended the data never changes so i no longer need to keep the
lookup. I am happy to have the macro assigned to a button, it doesnt have
to happen automatically when the period cell is changed. I just need the
macro to look for the period to ensure it copies the correct column. I am a
macro novice so any help gratefully received.
Thanks